mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-01 07:34:03 +02:00
Update search register when using f/t
This commit is contained in:
parent
a1639d80b0
commit
9240e82f2d
vim-engine/src/main/kotlin/com/maddyhome/idea/vim
@ -76,6 +76,13 @@ sealed class TillCharacterMotion(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
injector.motion.setLastFTCmd(tillCharacterMotionType, argument.character)
|
injector.motion.setLastFTCmd(tillCharacterMotionType, argument.character)
|
||||||
|
|
||||||
|
val offset = if (!finishBeforeCharacter) ""
|
||||||
|
else if (direction == Direction.FORWARDS) "s-1"
|
||||||
|
else "s+1"
|
||||||
|
|
||||||
|
injector.searchGroup.setLastSearchState(argument.character.let { if (it == '.') "\\." else it.toString() }, offset, direction)
|
||||||
|
|
||||||
return res.toMotionOrError()
|
return res.toMotionOrError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,4 +206,17 @@ interface VimSearchGroup {
|
|||||||
* Returns true if any text is selected in the visible editors, false otherwise.
|
* Returns true if any text is selected in the visible editors, false otherwise.
|
||||||
*/
|
*/
|
||||||
fun isSomeTextHighlighted(): Boolean
|
fun isSomeTextHighlighted(): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the last search state purely for tests
|
||||||
|
*
|
||||||
|
* @param pattern The pattern to save. This is the last search pattern, not the last substitute pattern
|
||||||
|
* @param patternOffset The pattern offset, e.g. `/{pattern}/{offset}`
|
||||||
|
* @param direction The direction to search
|
||||||
|
*/
|
||||||
|
fun setLastSearchState(
|
||||||
|
pattern: String,
|
||||||
|
patternOffset: String,
|
||||||
|
direction: Direction,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
@ -1425,8 +1425,7 @@ abstract class VimSearchGroupBase : VimSearchGroup {
|
|||||||
* @param patternOffset The pattern offset, e.g. `/{pattern}/{offset}`
|
* @param patternOffset The pattern offset, e.g. `/{pattern}/{offset}`
|
||||||
* @param direction The direction to search
|
* @param direction The direction to search
|
||||||
*/
|
*/
|
||||||
@TestOnly
|
override fun setLastSearchState(
|
||||||
fun setLastSearchState(
|
|
||||||
pattern: String,
|
pattern: String,
|
||||||
patternOffset: String,
|
patternOffset: String,
|
||||||
direction: Direction,
|
direction: Direction,
|
||||||
|
Loading…
Reference in New Issue
Block a user