Christian wrote:

> I just received a bug for vim-airline for which I suspect this might be 
> caused by a vim particularity. The bug is here:
> https://github.com/vim-airline/vim-airline/issues/1989
> 
> The symptom is, that if one uses 'R' and replaces a bit, and right after 
> that presses 'r' the statusline switches to 'REPLACE' mode, which is 
> wrong. However the next time you press 'r', it won't switch to 
> 'REPLACE'.  However I see this behaviour only on Windows gvim, not in 
> the terminal.
> 
> The whole mode, is always updated every time the statusline is 
> re-evaluated, by throwing a function airline#check_mode into the 
> statusline.
> 
> What this function does essentially is check `mode(1)` and update the 
> string that will be displayed (and if the mode changes, it might as well 
> update a couple of highlighting groups).
> 
> Now, I did debug this a bit and the thing is, that apparently `mode(1)` 
> keeps returning `R`, even so, it should return 'n' after pressing `r`. I 
> am a bit at loss at why this happens and I looked at the source f_mode() 
> but don't see what would cause this. In nv_replace I see that sometimes 
> the State will be updated to `REPLACE` for the 'r' command and I guess 
> this might be the cause for that, perhaps because it recursively forces 
> a screen update, but I am wondering why I only see this with gvim and
> I don't see this behaviour with a `vim --clean -c'set stl=%{mode(1)}'`.
> 
> Anybody has an idea how to "fix" this behaviour? However, I am not sure 
> it is worth the trouble at all.

AFAIK mode() will return "R" when the user just typed "r".  It's not
really replace mode, but it's in the state similar to replace mode.

However, it may be different if CURSOR_SHAPE is not defined.  I suppose
that's a bit inconsistent.  We can change that.

-- 
hundred-and-one symptoms of being an internet addict:
15. Your heart races faster and beats irregularly each time you see a new WWW
    site address in print or on TV, even though you've never had heart
    problems before.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201910311858.x9VIw6QB017753%40masaka.moolenaar.net.

Raspunde prin e-mail lui