IncSearch binding doesn't seem to work in visual mode
txtyash opened this issue · comments
map("x", "/", "<Esc>:lua require('searchbox').incsearch({visual_mode = true})<CR>", defo)
Maybe I don't know the point of this binding but it doesn't seem to do anything.
It does perform IncSearch but the visual mode selection goes away so either
visual selection is not supposed to disappear or there's no point of this
keybinding?
Also the lua api binding above works the same after removing <Esc>
,i.e. it
clears the visual selection anyways.
<Esc>
is there so the plugin can detect the range of the selection in a consistent way. If you don't add it, the search might take effect in a different area. I could not find a fix to that bug, so I recommend adding it. replace
also has some weird behavior when you are in visual mode.
If you don't experience any bug then I'm happy for you.
The point is to be an alternative to this type of search: /\%Vmy-search-pattern
. Even though the highlight of the selection gets lost the plugin will do the search in the right area.