Skip to content

Commit 064b366

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents fa4076a + 7547a78 commit 064b366

10 files changed

Lines changed: 140 additions & 29 deletions

File tree

src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,6 @@ test1 \
20492049
test_marks \
20502050
test_nested_function \
20512051
test_search_mbyte \
2052-
test_signs \
20532052
test_tagcase \
20542053
test_utf8 \
20552054
test_wordcount \
@@ -2127,10 +2126,11 @@ test_arglist \
21272126
test_regexp_utf8 \
21282127
test_reltime \
21292128
test_ruby \
2130-
test_startup \
21312129
test_searchpos \
21322130
test_set \
2131+
test_signs \
21332132
test_sort \
2133+
test_startup \
21342134
test_stat \
21352135
test_statusline \
21362136
test_syn_attr \

src/term.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6110,6 +6110,7 @@ gui_get_color_cmn(char_u *name)
61106110
{(char_u *)"gray", RGB(0xBE, 0xBE, 0xBE)},
61116111
{(char_u *)"green", RGB(0x00, 0xFF, 0x00)},
61126112
{(char_u *)"grey", RGB(0xBE, 0xBE, 0xBE)},
6113+
{(char_u *)"grey40", RGB(0x66, 0x66, 0x66)},
61136114
{(char_u *)"grey90", RGB(0xE5, 0xE5, 0xE5)},
61146115
{(char_u *)"lightblue", RGB(0xAD, 0xD8, 0xE6)},
61156116
{(char_u *)"lightcyan", RGB(0xE0, 0xFF, 0xFF)},

src/testdir/Make_all.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ SCRIPTS_ALL = \
102102
test_marks.out \
103103
test_nested_function.out \
104104
test_search_mbyte.out \
105-
test_signs.out \
106105
test_tagcase.out \
107106
test_utf8.out \
108107
test_wordcount.out \
@@ -184,6 +183,7 @@ NEW_TESTS = test_arglist.res \
184183
test_perl.res \
185184
test_quickfix.res \
186185
test_ruby.res \
186+
test_signs.res \
187187
test_startup.res \
188188
test_stat.res \
189189
test_syntax.res \

src/testdir/shared.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ endfunc
130130
" Plugins are not loaded, unless 'loadplugins' is set in "before".
131131
" Return 1 if Vim could be executed.
132132
func RunVim(before, after, arguments)
133-
call RunVimPiped(a:before, a:after, a:arguments, '')
133+
return RunVimPiped(a:before, a:after, a:arguments, '')
134134
endfunc
135135

136136
func RunVimPiped(before, after, arguments, pipecmd)

src/testdir/test_glob2regpat.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,25 @@
22

33
func Test_invalid()
44
call assert_fails('call glob2regpat(1.33)', 'E806:')
5+
call assert_fails('call glob2regpat("}")', 'E219:')
6+
call assert_fails('call glob2regpat("{")', 'E220:')
57
endfunc
68

79
func Test_valid()
810
call assert_equal('^foo\.', glob2regpat('foo.*'))
11+
call assert_equal('^foo.$', glob2regpat('foo?'))
912
call assert_equal('\.vim$', glob2regpat('*.vim'))
13+
call assert_equal('^[abc]$', glob2regpat('[abc]'))
14+
call assert_equal('^foo bar$', glob2regpat('foo\ bar'))
15+
call assert_equal('^foo,bar$', glob2regpat('foo,bar'))
16+
call assert_equal('^\(foo\|bar\)$', glob2regpat('{foo,bar}'))
17+
call assert_equal('.*', glob2regpat('**'))
18+
19+
if has('unix')
20+
call assert_equal('^foo?$', glob2regpat('foo\?'))
21+
call assert_equal('^\(foo,bar\|foobar\)$', glob2regpat('{foo\,bar,foobar}'))
22+
call assert_equal('^{foo,bar}$', glob2regpat('\{foo,bar\}'))
23+
call assert_equal('^\\\(foo\|bar\\\)$', glob2regpat('\\{foo,bar\\}'))
24+
" todo: Windows
25+
endif
1026
endfunc

src/testdir/test_signs.in

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/testdir/test_signs.ok

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/testdir/test_signs.vim

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
" Test for signs
2+
3+
if !has('signs')
4+
finish
5+
endif
6+
7+
func Test_sign()
8+
new
9+
call setline(1, ['a', 'b', 'c', 'd'])
10+
11+
sign define Sign1 text=x
12+
sign define Sign2 text=y
13+
14+
" Test listing signs.
15+
let a=execute('sign list')
16+
call assert_equal("\nsign Sign1 text=x \nsign Sign2 text=y ", a)
17+
18+
let a=execute('sign list Sign1')
19+
call assert_equal("\nsign Sign1 text=x ", a)
20+
21+
" Place the sign at line 3,then check that we can jump to it.
22+
exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')
23+
1
24+
exe 'sign jump 42 buffer=' . bufnr('')
25+
call assert_equal('c', getline('.'))
26+
27+
" Can't change sign.
28+
call assert_fails("exe 'sign place 43 name=Sign1 buffer=' . bufnr('')", 'E885:')
29+
30+
let a=execute('sign place')
31+
call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n line=3 id=42 name=Sign1\n", a)
32+
33+
" Unplace the sign and try jumping to it again should now fail.
34+
sign unplace 42
35+
1
36+
call assert_fails("exe 'sign jump 42 buffer=' . bufnr('')", 'E157:')
37+
call assert_equal('a', getline('.'))
38+
39+
" Unplace sign on current line.
40+
exe 'sign place 43 line=4 name=Sign2 buffer=' . bufnr('')
41+
4
42+
sign unplace
43+
let a=execute('sign place')
44+
call assert_equal("\n--- Signs ---\n", a)
45+
46+
" Try again to unplace sign on current line, it should fail this time.
47+
call assert_fails('sign unplace', 'E159:')
48+
49+
" Unplace all signs.
50+
exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')
51+
sign unplace *
52+
let a=execute('sign place')
53+
call assert_equal("\n--- Signs ---\n", a)
54+
55+
" After undefining the sign, we should no longer be able to place it.
56+
sign undefine Sign1
57+
sign undefine Sign2
58+
call assert_fails("exe 'sign place 42 line=3 name=Sign1 buffer=' . bufnr('')", 'E155:')
59+
60+
endfunc
61+
62+
func Test_sign_completion()
63+
sign define Sign1 text=x
64+
sign define Sign2 text=y
65+
66+
call feedkeys(":sign \<C-A>\<C-B>\"\<CR>", 'tx')
67+
call assert_equal('"sign define jump list place undefine unplace', @:)
68+
69+
call feedkeys(":sign define Sign \<C-A>\<C-B>\"\<CR>", 'tx')
70+
call assert_equal('"sign define Sign icon= linehl= text= texthl=', @:)
71+
72+
call feedkeys(":sign define Sign linehl=Spell\<C-A>\<C-B>\"\<CR>", 'tx')
73+
call assert_equal('"sign define Sign linehl=SpellBad SpellCap SpellLocal SpellRare', @:)
74+
75+
call feedkeys(":sign undefine \<C-A>\<C-B>\"\<CR>", 'tx')
76+
call assert_equal('"sign undefine Sign1 Sign2', @:)
77+
78+
call feedkeys(":sign place 1 \<C-A>\<C-B>\"\<CR>", 'tx')
79+
call assert_equal('"sign place 1 buffer= file= line= name=', @:)
80+
81+
call feedkeys(":sign place 1 name=\<C-A>\<C-B>\"\<CR>", 'tx')
82+
call assert_equal('"sign place 1 name=Sign1 Sign2', @:)
83+
84+
call feedkeys(":sign unplace 1 \<C-A>\<C-B>\"\<CR>", 'tx')
85+
call assert_equal('"sign unplace 1 buffer= file=', @:)
86+
87+
call feedkeys(":sign list \<C-A>\<C-B>\"\<CR>", 'tx')
88+
call assert_equal('"sign list Sign1 Sign2', @:)
89+
90+
call feedkeys(":sign jump 1 \<C-A>\<C-B>\"\<CR>", 'tx')
91+
call assert_equal('"sign jump 1 buffer= file=', @:)
92+
93+
sign undefine Sign1
94+
sign undefine Sign2
95+
96+
endfunc
97+
98+
func Test_sign_invalid_commands()
99+
call assert_fails('sign', 'E471:')
100+
call assert_fails('sign xxx', 'E160:')
101+
call assert_fails('sign define', 'E156:')
102+
call assert_fails('sign undefine', 'E156:')
103+
call assert_fails('sign list xxx', 'E155:')
104+
call assert_fails('sign place 1 buffer=', 'E158:')
105+
call assert_fails('sign define Sign2 text=', 'E239:')
106+
endfunc

src/testdir/test_timers.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func Test_repeat_three()
2727
let timer = timer_start(50, 'MyHandler', {'repeat': 3})
2828
let slept = WaitFor('g:val == 3')
2929
call assert_equal(3, g:val)
30-
call assert_inrange(100, 250, slept)
30+
call assert_inrange(80, 200, slept)
3131
endfunc
3232

3333
func Test_repeat_many()

src/version.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,18 @@ static char *(features[]) =
778778

779779
static int included_patches[] =
780780
{ /* Add new patch number below this line */
781+
/**/
782+
2187,
783+
/**/
784+
2186,
785+
/**/
786+
2185,
787+
/**/
788+
2184,
789+
/**/
790+
2183,
791+
/**/
792+
2182,
781793
/**/
782794
2181,
783795
/**/

0 commit comments

Comments
 (0)