diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-02-10 21:55:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-02-10 21:55:26 +0100 |
commit | 9474716d39764ac5642e55b5548580cf53bd9bed (patch) | |
tree | f11d99a5640ad6342c503ea74afdf028d972725b | |
parent | b7633611611eeb5f14f8fd598afa687964e23f23 (diff) | |
download | vim-git-9474716d39764ac5642e55b5548580cf53bd9bed.tar.gz |
patch 8.1.0887: the 'l' flag in :subsitute is stickyv8.1.0887
Problem: The 'l' flag in :subsitute is sticky.
Solution: Reset the flag. (Dominique Pelle, closes #3925)
-rw-r--r-- | src/ex_cmds.c | 3 | ||||
-rw-r--r-- | src/testdir/test_substitute.vim | 26 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 30 insertions, 1 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 681ef422a..abb5f7096 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2098,7 +2098,7 @@ write_viminfo(char_u *file, int forceit) fp_out = NULL; # ifdef EEXIST /* Avoid trying lots of names while the problem is lack - * of premission, only retry if the file already + * of permission, only retry if the file already * exists. */ if (errno != EEXIST) break; @@ -5040,6 +5040,7 @@ do_sub(exarg_T *eap) } subflags.do_error = TRUE; subflags.do_print = FALSE; + subflags.do_list = FALSE; subflags.do_count = FALSE; subflags.do_number = FALSE; subflags.do_ic = 0; diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim index d84daa721..0ae407d8a 100644 --- a/src/testdir/test_substitute.vim +++ b/src/testdir/test_substitute.vim @@ -107,6 +107,32 @@ func Test_substitute_variants() endfor endfunc +" Test the l, p, # flags. +func Test_substitute_flags_lp() + new + call setline(1, "abc\tdef\<C-h>ghi") + + let a = execute('s/a/a/p') + call assert_equal("\nabc def^Hghi", a) + + let a = execute('s/a/a/l') + call assert_equal("\nabc^Idef^Hghi$", a) + + let a = execute('s/a/a/#') + call assert_equal("\n 1 abc def^Hghi", a) + + let a = execute('s/a/a/p#') + call assert_equal("\n 1 abc def^Hghi", a) + + let a = execute('s/a/a/l#') + call assert_equal("\n 1 abc^Idef^Hghi$", a) + + let a = execute('s/a/a/') + call assert_equal("", a) + + bwipe! +endfunc + func Test_substitute_repeat() " This caused an invalid memory access. split Xfile diff --git a/src/version.c b/src/version.c index aa17e0afa..94825f826 100644 --- a/src/version.c +++ b/src/version.c @@ -784,6 +784,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 887, +/**/ 886, /**/ 885, |