mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch:9.0.1255: changing 'virtualedit' does not have immediate effect (#22039)
Problem: Changing 'virtualedit' does not have immediate effect.
Solution: Correct how is checked for a changed value. (closes vim/vim#11878)
8fe5b9c8c1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -1404,10 +1404,11 @@ static void did_set_virtualedit(win_T *win, int opt_flags, char *oldval, char **
|
|||||||
} else {
|
} else {
|
||||||
if (opt_strings_flags(ve, p_ve_values, flags, true) != OK) {
|
if (opt_strings_flags(ve, p_ve_values, flags, true) != OK) {
|
||||||
*errmsg = e_invarg;
|
*errmsg = e_invarg;
|
||||||
} else if (strcmp(p_ve, oldval) != 0) {
|
} else if (strcmp(ve, oldval) != 0) {
|
||||||
// Recompute cursor position in case the new 've' setting
|
// Recompute cursor position in case the new 've' setting
|
||||||
// changes something.
|
// changes something.
|
||||||
validate_virtcol_win(win);
|
validate_virtcol_win(win);
|
||||||
|
// XXX: this only works when win == curwin
|
||||||
coladvance(win->w_virtcol);
|
coladvance(win->w_virtcol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -537,6 +537,19 @@ func Test_global_local_virtualedit()
|
|||||||
set virtualedit&
|
set virtualedit&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_virtualedit_setlocal()
|
||||||
|
enew
|
||||||
|
setglobal virtualedit=all
|
||||||
|
setlocal virtualedit=all
|
||||||
|
normal! l
|
||||||
|
redraw
|
||||||
|
setlocal virtualedit=none
|
||||||
|
call assert_equal(1, wincol())
|
||||||
|
|
||||||
|
setlocal virtualedit&
|
||||||
|
set virtualedit&
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_virtualedit_mouse()
|
func Test_virtualedit_mouse()
|
||||||
let save_mouse = &mouse
|
let save_mouse = &mouse
|
||||||
set mouse=a
|
set mouse=a
|
||||||
|
Reference in New Issue
Block a user