vim: Retain search direction upon search submit (#16754)

Before, when using `?` and `#` for backwards search it would initially
search for the previous match, but upon subsequent inputs to `n` and
`N`, `n` is always treated as "forward" and `N` is always treated as
"backward", instead of continuing the search direction.

now, if i use `?` or `#` for backward search, `n` will go to the
previous selection, and `N` will go to the next. Functionality stays the
same for `/` and `*`.

Release Notes:

- vim: Fixed `n` direction after searching backwards

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
fletcher gornick 2024-08-27 19:50:19 -05:00 committed by GitHub
parent bef575e30a
commit cfc3b7de05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 2 deletions

View file

@ -0,0 +1,8 @@
{"Put":{"state":"ˇa b a b a b a"}}
{"Key":"*"}
{"Key":"n"}
{"Get":{"state":"a b a b ˇa b a","mode":"Normal"}}
{"Key":"#"}
{"Get":{"state":"a b ˇa b a b a","mode":"Normal"}}
{"Key":"n"}
{"Get":{"state":"ˇa b a b a b a","mode":"Normal"}}