Skip to content

Commit 7c0d06c

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents f5464c4 + fe38b49 commit 7c0d06c

File tree

4 files changed

+94
-4
lines changed

4 files changed

+94
-4
lines changed

src/ex_docmd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,7 +2284,11 @@ do_one_cmd(
22842284
if (*ea.cmd == ';')
22852285
{
22862286
if (!ea.skip)
2287+
{
22872288
curwin->w_cursor.lnum = ea.line2;
2289+
/* don't leave the cursor on an illegal line */
2290+
check_cursor_lnum();
2291+
}
22882292
}
22892293
else if (*ea.cmd != ',')
22902294
break;
@@ -2300,9 +2304,6 @@ do_one_cmd(
23002304
ea.addr_count = 0;
23012305
}
23022306

2303-
/* Don't leave the cursor on an illegal line (caused by ';') */
2304-
check_cursor_lnum();
2305-
23062307
/*
23072308
* 5. Parse the command.
23082309
*/

src/testdir/test_cmdline.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,3 +234,10 @@ func Test_remove_char_in_cmdline()
234234
call feedkeys(":abc def\<S-Left>\<C-U>\<C-B>\"\<CR>", 'tx')
235235
call assert_equal('"def', @:)
236236
endfunc
237+
238+
func Test_illegal_address()
239+
new
240+
2;'(
241+
2;')
242+
quit
243+
endfunc

src/testdir/test_syntax.vim

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func Test_syn_iskeyword()
5454
setlocal isk-=_
5555
call assert_equal('DLTD_BY', GetSyntaxItem('DLTD'))
5656
/\<D\k\+\>/:norm! ygn
57-
let b2=@0
57+
let b2 = @0
5858
call assert_equal('DLTD', @0)
5959

6060
syn iskeyword clear
@@ -80,3 +80,79 @@ func Test_syntax_after_reload()
8080
call assert_true(exists('g:gotit'))
8181
call delete('Xsomefile')
8282
endfunc
83+
84+
func Test_syntime()
85+
if !has('profile')
86+
return
87+
endif
88+
89+
syntax on
90+
syntime on
91+
let a = execute('syntime report')
92+
call assert_equal("\nNo Syntax items defined for this buffer", a)
93+
94+
view ../memfile_test.c
95+
setfiletype cpp
96+
redraw
97+
let a = execute('syntime report')
98+
call assert_match('^ TOTAL *COUNT *MATCH *SLOWEST *AVERAGE *NAME *PATTERN', a)
99+
call assert_match(' \d*\.\d* \+[^0]\d* .* cppRawString ', a)
100+
call assert_match(' \d*\.\d* \+[^0]\d* .* cppNumber ', a)
101+
102+
syntime off
103+
syntime clear
104+
let a = execute('syntime report')
105+
call assert_match('^ TOTAL *COUNT *MATCH *SLOWEST *AVERAGE *NAME *PATTERN', a)
106+
call assert_notmatch('.* cppRawString *', a)
107+
call assert_notmatch('.* cppNumber*', a)
108+
call assert_notmatch('[1-9]', a)
109+
110+
call assert_fails('syntime abc', 'E475')
111+
112+
syntax clear
113+
let a = execute('syntime report')
114+
call assert_equal("\nNo Syntax items defined for this buffer", a)
115+
116+
bd
117+
endfunc
118+
119+
func Test_syntax_list()
120+
syntax on
121+
let a = execute('syntax list')
122+
call assert_equal("\nNo Syntax items defined for this buffer", a)
123+
124+
view ../memfile_test.c
125+
setfiletype c
126+
127+
let a = execute('syntax list')
128+
call assert_match('cInclude*', a)
129+
call assert_match('cDefine', a)
130+
131+
let a = execute('syntax list cDefine')
132+
call assert_notmatch('cInclude*', a)
133+
call assert_match('cDefine', a)
134+
call assert_match(' links to Macro$', a)
135+
136+
call assert_fails('syntax list ABCD', 'E28:')
137+
call assert_fails('syntax list @ABCD', 'E392:')
138+
139+
syntax clear
140+
let a = execute('syntax list')
141+
call assert_equal("\nNo Syntax items defined for this buffer", a)
142+
143+
bd
144+
endfunc
145+
146+
func Test_syntax_completion()
147+
call feedkeys(":syn \<C-A>\<C-B>\"\<CR>", 'tx')
148+
call assert_equal('"syn case clear cluster conceal enable include iskeyword keyword list manual match off on region reset spell sync', @:)
149+
150+
call feedkeys(":syn case \<C-A>\<C-B>\"\<CR>", 'tx')
151+
call assert_equal('"syn case ignore match', @:)
152+
153+
call feedkeys(":syn list \<C-A>\<C-B>\"\<CR>", 'tx')
154+
call assert_match('^"syn list Boolean Character ', @:)
155+
156+
call feedkeys(":syn match \<C-A>\<C-B>\"\<CR>", 'tx')
157+
call assert_match('^"syn match Boolean Character ', @:)
158+
endfunc

src/version.c

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

780780
static int included_patches[] =
781781
{ /* Add new patch number below this line */
782+
/**/
783+
133,
784+
/**/
785+
132,
786+
/**/
787+
131,
782788
/**/
783789
130,
784790
/**/

0 commit comments

Comments
 (0)