diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/screen.c | 7 | ||||
-rw-r--r-- | src/testdir/test_listchars.vim | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/screen.c b/src/screen.c index fd69cf0b3d..ac24a16464 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4726,7 +4726,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply) } // first round: check for valid value, second round: assign values - for (round = 0; round <= 1; ++round) + for (round = 0; round <= (apply ? 1 : 0); ++round) { if (round > 0) { @@ -4913,11 +4913,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply) wp->w_fill_chars = fill_chars; } } - else if (is_listchars) - { - vim_free(lcs_chars.multispace); - vim_free(lcs_chars.leadmultispace); - } return NULL; // no error } diff --git a/src/testdir/test_listchars.vim b/src/testdir/test_listchars.vim index 8628fb20e0..57ddcda7e5 100644 --- a/src/testdir/test_listchars.vim +++ b/src/testdir/test_listchars.vim @@ -265,6 +265,11 @@ func Test_listchars() call Check_listchars(expected, 5, 12) call assert_equal(expected, split(execute("%list"), "\n")) + " Changing the value of 'ambiwidth' twice shouldn't cause double-free when + " "leadmultispace" is specified. + set ambiwidth=double + set ambiwidth& + " Test leadmultispace and lead and space normal ggdG set listchars& diff --git a/src/version.c b/src/version.c index 801ca36d13..8e35aaa09d 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2126, +/**/ 2125, /**/ 2124, |