mirror of
https://github.com/chylex/IntelliJ-AceJump.git
synced 2025-05-07 17:34:03 +02:00
[WIP] Pressing Enter before typing query starts jump mode for character at caret
This commit is contained in:
parent
2f6a5f2a23
commit
47a84da904
@ -13,6 +13,7 @@ import com.intellij.ui.LightweightHint
|
||||
import org.acejump.ExternalUsage
|
||||
import org.acejump.boundaries.Boundaries
|
||||
import org.acejump.config.AceConfig
|
||||
import org.acejump.immutableText
|
||||
import org.acejump.input.EditorKeyListener
|
||||
import org.acejump.input.KeyLayoutCache
|
||||
import org.acejump.modes.BetweenPointsMode
|
||||
@ -161,7 +162,21 @@ class Session(private val editor: Editor) {
|
||||
}
|
||||
|
||||
fun tagImmediately() {
|
||||
state?.currentProcessor?.let { updateSearch(it, markImmediately = true) }
|
||||
val state = state ?: return
|
||||
val processor = state.currentProcessor
|
||||
|
||||
if (processor != null) {
|
||||
updateSearch(processor, markImmediately = true)
|
||||
}
|
||||
else if (mode is JumpMode) {
|
||||
val offset = editor.caretModel.offset
|
||||
val result = editor.immutableText.getOrNull(offset)?.let(state::type)
|
||||
if (result is TypeResult.UpdateResults) {
|
||||
acceptedTag = offset
|
||||
textHighlighter.renderFinal(offset, result.processor.query)
|
||||
updateHint()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user