Friday, October 26, 2012

Re: About b:changetick

On Friday, October 26, 2012 9:43:14 AM UTC-5, John Miller wrote:
> Is the b:changetick variable supposed to change when you navigate the buffer with the arrow keys in insert mode (it does change for me)?
>

No, and it doesn't for me. Maybe you have a plugin or CursorMovedI autocmd interfering with normal operation.

Try without any config: vim -N -u NONE -i NONE
Try without any plugins but with your .vimrc: vim --noplugin

If the problem persists with the second but not the first, you have a .vimrc issue. If the problem is gone with both of these, you have a plugin issue. If the problem persists with both, then you have something weird going on, because it works for me in gvim 7.3.709 on Windows. What is your Vim version? Are you using terminal vim or GUI Vim (gvim)?

> I can see that the docs say that "An undo command is also a change in this case" and this kind of navigation is certainly undoable so is this the reason for the behavior?
>

No, this just means that undoing with the 'u' command or redoing with <C-R> will also increment the variable.

> Is there some another built-in way to detect when the actual contents of the buffer has changed? (obviously you can implement such check with a bit of a VimL)

Yes, the b:changetick variable is supposed to provide this.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: