-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
saving on TextChanged event breaks vim-repeat #59
Comments
Today I decided to figure out why does vim-repeat not work for me. Yes, basically due to this. My autocmd is similar (a Vim hack auto-save):
In the meantime recording a macro is the way to go to do vim-surround repeats for those who do the above style Many thanks. |
This reminds me - I should add that this only breaks with Interestingly, vim-sandwich works fine with vim-repeat and saving on textchanged. Minimal vimrc that works fine:
Maybe this issue should be raised on vim-surround's issues instead? |
@swalladge this is not entirely correct. |
@ironhouzi yes it's needed for many plugins, but it doesn't break with all plugins that use it. That's the reason why I'm not sure if the issue is in vim-repeat, or the issue is with how other plugins use it. |
FYI The HEAD version of commentary.vim no longer requires repeat.vim, which might be the source of some confusion. If you're looking for another plugin to test against, try |
Worth noting, the vim-auto-save plugin does work with vim-repeat. So if your only need to use the These are the settings I use: Plug '907th/vim-auto-save'
let g:auto_save = 1
let g:auto_save_silent = 1
let g:auto_save_events = ["InsertLeave", "TextChanged", "FocusLost"] Thanks to @tpope for all your contributions. |
@bluz71 great find! I believe I have found a lead based on this.
Now it remains to be seen why this works... |
Update: vim-repeat relies on the vim-repeat/autoload/repeat.vim Line 141 in 8106e14
g:repeat_tick will not be updated. It sounds like something similar to #63 where b:changedtick is suddenly a value that vim-repeat isn't expecting.
|
Is there a way to make vim-repeat work along with |
@MahbubAlam231 see my previous comment for a work around (add |
Thanks @swalladge , it works. I do not quite understand vim script yet, I read
|
Okay, makes sense, the old autocommand was broken and adding |
Minimal vimrc displaying this behaviour:
An example of what happens:
ysiw)
to surround a word with parentheses..
to repeat the surround on another wordysiw
)
completes the surround as expected.I haven't read the source of vim-repeat, so not sure exactly why this might be happening. The help for
TextChanged
says that it's fired whenb:changedtick
is changed, so I'm guessing it saves the file halfway through the initial command, which makes only part of the commend registered with vim-repeat somehow...The text was updated successfully, but these errors were encountered: