mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 7.4.1017
Problem: When there is a backslash in an option ":set -=" doesn't work. Solution: Handle a backslash better. (Jacob Niehus) Add a new test, merge in old test.
This commit is contained in:
@@ -1958,7 +1958,6 @@ test1 \
|
|||||||
test_qf_title \
|
test_qf_title \
|
||||||
test_ruby \
|
test_ruby \
|
||||||
test_search_mbyte \
|
test_search_mbyte \
|
||||||
test_set \
|
|
||||||
test_signs \
|
test_signs \
|
||||||
test_tagcase \
|
test_tagcase \
|
||||||
test_textobjects \
|
test_textobjects \
|
||||||
@@ -1980,6 +1979,7 @@ test1 \
|
|||||||
test_assert \
|
test_assert \
|
||||||
test_cdo \
|
test_cdo \
|
||||||
test_searchpos \
|
test_searchpos \
|
||||||
|
test_set \
|
||||||
test_sort \
|
test_sort \
|
||||||
test_undolevels \
|
test_undolevels \
|
||||||
test_viml \
|
test_viml \
|
||||||
|
12
src/option.c
12
src/option.c
@@ -4839,9 +4839,15 @@ do_set(arg, opt_flags)
|
|||||||
|| s[i] == NUL))
|
|| s[i] == NUL))
|
||||||
break;
|
break;
|
||||||
/* Count backslashes. Only a comma with an
|
/* Count backslashes. Only a comma with an
|
||||||
* even number of backslashes before it is
|
* even number of backslashes or a single
|
||||||
* recognized as a separator */
|
* backslash preceded by a comma before it
|
||||||
if (s > origval && s[-1] == '\\')
|
* is recognized as a separator */
|
||||||
|
if ((s > origval + 1
|
||||||
|
&& s[-1] == '\\'
|
||||||
|
&& s[-2] != ',')
|
||||||
|
|| (s == origval + 1
|
||||||
|
&& s[-1] == '\\'))
|
||||||
|
|
||||||
++bs;
|
++bs;
|
||||||
else
|
else
|
||||||
bs = 0;
|
bs = 0;
|
||||||
|
@@ -3,5 +3,6 @@
|
|||||||
|
|
||||||
source test_lispwords.vim
|
source test_lispwords.vim
|
||||||
source test_searchpos.vim
|
source test_searchpos.vim
|
||||||
|
source test_set.vim
|
||||||
source test_sort.vim
|
source test_sort.vim
|
||||||
source test_undolevels.vim
|
source test_undolevels.vim
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
|
" Tests for the :cdo, :cfdo, :ldo and :lfdo commands
|
||||||
|
|
||||||
lang mess C
|
|
||||||
if !has('quickfix')
|
if !has('quickfix')
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
Tests for :set vim: set ft=vim :
|
|
||||||
|
|
||||||
STARTTEST
|
|
||||||
:so small.vim
|
|
||||||
:set wildignore=*.png,
|
|
||||||
:set wildignore+=*.jpg
|
|
||||||
:$put =&wildignore
|
|
||||||
:/^Output goes here/+1,$w! test.out
|
|
||||||
:qa!
|
|
||||||
ENDTEST
|
|
||||||
|
|
||||||
Output goes here
|
|
@@ -1 +0,0 @@
|
|||||||
*.png,*.jpg
|
|
27
src/testdir/test_set.vim
Normal file
27
src/testdir/test_set.vim
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
" Tests for the :set command
|
||||||
|
|
||||||
|
function Test_set_backslash()
|
||||||
|
let isk_save = &isk
|
||||||
|
|
||||||
|
set isk=a,b,c
|
||||||
|
set isk+=d
|
||||||
|
call assert_equal('a,b,c,d', &isk)
|
||||||
|
set isk+=\\,e
|
||||||
|
call assert_equal('a,b,c,d,\,e', &isk)
|
||||||
|
set isk-=e
|
||||||
|
call assert_equal('a,b,c,d,\', &isk)
|
||||||
|
set isk-=\\
|
||||||
|
call assert_equal('a,b,c,d', &isk)
|
||||||
|
|
||||||
|
let &isk = isk_save
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function Test_set_add()
|
||||||
|
let wig_save = &wig
|
||||||
|
|
||||||
|
set wildignore=*.png,
|
||||||
|
set wildignore+=*.jpg
|
||||||
|
call assert_equal('*.png,*.jpg', &wig)
|
||||||
|
|
||||||
|
let &wig = wig_save
|
||||||
|
endfunction
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1017,
|
||||||
/**/
|
/**/
|
||||||
1016,
|
1016,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user