Skip to content

Commit 8fe5b9c

Browse files
committed
patch 9.0.1255: changing 'virtualedit' does not have immediate effect
Problem: Changing 'virtualedit' does not have immediate effect. Solution: Correct how is checked for a changed value. (closes #11878)
1 parent d0200c8 commit 8fe5b9c

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/optionstr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2078,7 +2078,7 @@ did_set_string_option(
20782078
{
20792079
if (opt_strings_flags(ve, p_ve_values, flags, TRUE) != OK)
20802080
errmsg = e_invalid_argument;
2081-
else if (STRCMP(p_ve, oldval) != 0)
2081+
else if (STRCMP(ve, oldval) != 0)
20822082
{
20832083
// Recompute cursor position in case the new 've' setting
20842084
// changes something.

src/testdir/test_virtualedit.vim

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,19 @@ func Test_global_local_virtualedit()
537537
set virtualedit&
538538
endfunc
539539

540+
func Test_virtualedit_setlocal()
541+
enew
542+
setglobal virtualedit=all
543+
setlocal virtualedit=all
544+
normal! l
545+
redraw
546+
setlocal virtualedit=none
547+
call assert_equal(1, wincol())
548+
549+
setlocal virtualedit&
550+
set virtualedit&
551+
endfunc
552+
540553
func Test_virtualedit_mouse()
541554
let save_mouse = &mouse
542555
set mouse=a

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,8 @@ static char *(features[]) =
695695

696696
static int included_patches[] =
697697
{ /* Add new patch number below this line */
698+
/**/
699+
1255,
698700
/**/
699701
1254,
700702
/**/

0 commit comments

Comments
 (0)