rhysd / clever-f.vim

Extended f, F, t and T key mappings for Vim.
https://rhysd.github.io/clever-f.vim
1.01k stars 44 forks source link

Breaks lazyredraw #57

Closed aldevv closed 3 years ago

aldevv commented 3 years ago

when using a macro with lazyredraw on, the screen should not redraw, but when using f, F, t and T, the screen will always redraw.

I tested this with a bare neovim config

rhysd commented 3 years ago

Please provide steps to reproduce the issue.

aldevv commented 3 years ago

Please provide steps to reproduce the issue.

  1. Install clever-f in neovim
  2. open a file with some text
  3. press q and any letter to start a macro
  4. use f, F, t or T in the macro
  5. press q to save the macro
  6. run the macro on any number of lines
rhysd commented 3 years ago

I tried following steps but it worked correctly. Can you provide more exact steps and expected/actual behaviors?

  1. Install clever-f.vim
  2. Open file with text foo abc abc abc abc
  3. set lazyredraw
  4. qa to start macro recording
  5. faff to move cursor to the 3rd 'a'
  6. q to stop macro recording
  7. 0 to move cursor to the head of line
  8. @a to run the macro
  9. Check the cursor moved to the 3rd 'a' again
aldevv commented 3 years ago

as an example, say you have a file with this line abc { abc } repeated 5000 lines, like this

abc { abc }
abc { abc }
abc { abc }
.
.
.
abc { abc }

if you create a macro for deleting the { abc } part in every line, you would do it like this:

  1. qa start macro
  2. t{d$0j delete { abc } and move to the beginning of the next line
  3. q
  4. 4999@a

Actual Behaviour Applying this macro with set lazyredraw doesn't work, you can see how the macro is deleting each { abc } in the buffer in real time.

Expected Behaviour Applying this macro with set lazyredraw would freeze the buffer until the macro is done. then it should redraw the buffer to see the changes the macro did.

vim neovim 0.5.0 nightly

rhysd commented 3 years ago

Thank you for the details. Let me try it out.

rhysd commented 3 years ago

I could fix the issue at 52e0025. Please update to the latest. Thank you for the details to reproduce the issue.

rhysd commented 3 years ago

Note that this issue was only fixed in below versions.