diff options
author | neeshy <60193883+neeshy@users.noreply.github.com> | 2025-02-09 16:23:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-09 13:23:30 -0800 |
commit | 59a171fd99a7452c8840eee55783fb6746994637 (patch) | |
tree | 426c9455c6f6a250e015a460dd232ed26d603b9f /runtime/lua/vim/snippet.lua | |
parent | ac207c3ac20026baa2a4561f5365c2af6a38a357 (diff) | |
download | rneovim-59a171fd99a7452c8840eee55783fb6746994637.tar.gz rneovim-59a171fd99a7452c8840eee55783fb6746994637.tar.bz2 rneovim-59a171fd99a7452c8840eee55783fb6746994637.zip |
fix(defaults): improve visual search mappings #32378
Problem: The behavior of the visual search mappings aren't consistent
with their normal mode counterparts.
- The count isn't considered
- Searching with an empty selection will match every character in the
buffer
- Searching backwards only jumps back when the cursor is positioned at
the start of the selection.
Solution:
- Issue `n` `v:count1` times
- Error out and exit visual mode when the selection is empty
- Detect when the cursor is not at the start of the selection, and
adjust the count accordingly
Also, use the search register instead of the more error-prone approach
of feeding the entire search string as an expression
Diffstat (limited to 'runtime/lua/vim/snippet.lua')
0 files changed, 0 insertions, 0 deletions