diff --git a/README.md b/README.md index 5502de6..b66b70e 100644 --- a/README.md +++ b/README.md @@ -216,9 +216,13 @@ Install the plugin with your preferred package manager: - use a jump label, or use `;` and `,` to increase/decrease the selection - **regular search**: search as you normally do, but enhanced with jump labels - `f`, `t`, `F`, `T` motions: - - go to next match with `;` or repeat the motion character like `f` - - go to previous match with `,` - - highlights clear automatically when moving, changing buffers or pressing `` + - After typing `f{char}` or `F{char},` you can repeat the motion with `f` + or go to the previous match with `F` to undo a jump. + - Similarly, after typing `t{char}` or `T{char},` you can repeat the motion + with `t` or go to the previous match with `T`. + - You can also go to the next match with `;` or previous match with `,` + - Any highlights clear automatically when moving, changing buffers, + or pressing ``. - `require("flash").jump(opts?)` opens **flash** with the given options - type any number of characters before typing a jump label diff --git a/lua/flash/plugins/char.lua b/lua/flash/plugins/char.lua index 897fce8..c9a3cc2 100644 --- a/lua/flash/plugins/char.lua +++ b/lua/flash/plugins/char.lua @@ -91,8 +91,12 @@ end function M.parse(key) -- repeat last search when hitting the same key - if M.visible() and M.motion == key then - key = ";" + if M.visible() then + if M.motion:lower() == key then + key = ";" + elseif M.motion:upper() == key then + key = "," + end end -- different motion, clear the state if M.motions[key] and M.motion ~= key then