mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.1040: not enough testing for movement commands
Problem: Not enough testing for movement commands. Solution: Add more tests. (Yegappan Lakshmanan, closes #6313)
This commit is contained in:
parent
25fd267287
commit
bdd2c290d3
@ -99,6 +99,7 @@ func Test_screenpos()
|
|||||||
\ 'curscol': wincol + 9,
|
\ 'curscol': wincol + 9,
|
||||||
\ 'endcol': wincol + 9}, screenpos(winid, 2, 22))
|
\ 'endcol': wincol + 9}, screenpos(winid, 2, 22))
|
||||||
close
|
close
|
||||||
|
call assert_equal({}, screenpos(999, 1, 1))
|
||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@ -475,6 +475,11 @@ func Test_simplify()
|
|||||||
call assert_equal('./file', simplify('./dir/../file'))
|
call assert_equal('./file', simplify('./dir/../file'))
|
||||||
call assert_equal('../dir/file', simplify('dir/../../dir/file'))
|
call assert_equal('../dir/file', simplify('dir/../../dir/file'))
|
||||||
call assert_equal('./file', simplify('dir/.././file'))
|
call assert_equal('./file', simplify('dir/.././file'))
|
||||||
|
call assert_equal('../dir', simplify('./../dir'))
|
||||||
|
call assert_equal('..', simplify('../testdir/..'))
|
||||||
|
call mkdir('Xdir')
|
||||||
|
call assert_equal('.', simplify('Xdir/../.'))
|
||||||
|
call delete('Xdir', 'd')
|
||||||
|
|
||||||
call assert_fails('call simplify({->0})', 'E729:')
|
call assert_fails('call simplify({->0})', 'E729:')
|
||||||
call assert_fails('call simplify([])', 'E730:')
|
call assert_fails('call simplify([])', 'E730:')
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
" Test for the gf and gF (goto file) commands
|
||||||
|
|
||||||
" This is a test if a URL is recognized by "gf", with the cursor before and
|
" This is a test if a URL is recognized by "gf", with the cursor before and
|
||||||
" after the "://". Also test ":\\".
|
" after the "://". Also test ":\\".
|
||||||
@ -38,6 +39,13 @@ func Test_gf_url()
|
|||||||
call search("URL")
|
call search("URL")
|
||||||
call assert_equal("URL://machine.name:1234?q=vim", expand("<cfile>"))
|
call assert_equal("URL://machine.name:1234?q=vim", expand("<cfile>"))
|
||||||
|
|
||||||
|
%d
|
||||||
|
call setline(1, "demo://remote_file")
|
||||||
|
wincmd f
|
||||||
|
call assert_equal('demo://remote_file', @%)
|
||||||
|
call assert_equal(2, winnr('$'))
|
||||||
|
close!
|
||||||
|
|
||||||
set isf&vim
|
set isf&vim
|
||||||
enew!
|
enew!
|
||||||
endfunc
|
endfunc
|
||||||
@ -118,6 +126,11 @@ func Test_gf_visual()
|
|||||||
norm! ttvtXgf
|
norm! ttvtXgf
|
||||||
call assert_equal('Xtest_gf_visual', bufname('%'))
|
call assert_equal('Xtest_gf_visual', bufname('%'))
|
||||||
|
|
||||||
|
" if multiple lines are selected, then gf should fail
|
||||||
|
call setline(1, ["one", "two"])
|
||||||
|
normal VGgf
|
||||||
|
call assert_equal('Xtest_gf_visual', @%)
|
||||||
|
|
||||||
bwipe!
|
bwipe!
|
||||||
call delete('Xtest_gf_visual')
|
call delete('Xtest_gf_visual')
|
||||||
set hidden&
|
set hidden&
|
||||||
@ -146,4 +159,21 @@ func Test_gf_error()
|
|||||||
bwipe!
|
bwipe!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" If a file is not found by 'gf', then 'includeexpr' should be used to locate
|
||||||
|
" the file.
|
||||||
|
func Test_gf_includeexpr()
|
||||||
|
new
|
||||||
|
let g:Inc_fname = ''
|
||||||
|
func IncFunc()
|
||||||
|
let g:Inc_fname = v:fname
|
||||||
|
return v:fname
|
||||||
|
endfunc
|
||||||
|
setlocal includeexpr=IncFunc()
|
||||||
|
call setline(1, 'somefile.java')
|
||||||
|
call assert_fails('normal gf', 'E447:')
|
||||||
|
call assert_equal('somefile.java', g:Inc_fname)
|
||||||
|
close!
|
||||||
|
delfunc IncFunc
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -754,8 +754,9 @@ func Test_normal17_z_scroll_hor2()
|
|||||||
bw!
|
bw!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" Test for H, M and L commands with folds
|
" Test for commands that scroll the window horizontally. Test with folds.
|
||||||
func Test_scroll_cmds()
|
" H, M, L, CTRL-E, CTRL-Y, CTRL-U, CTRL-D, PageUp, PageDown commands
|
||||||
|
func Test_vert_scroll_cmds()
|
||||||
15new
|
15new
|
||||||
call setline(1, range(1, 100))
|
call setline(1, range(1, 100))
|
||||||
exe "normal! 30ggz\<CR>"
|
exe "normal! 30ggz\<CR>"
|
||||||
@ -764,6 +765,8 @@ func Test_scroll_cmds()
|
|||||||
40,43fold
|
40,43fold
|
||||||
46,49fold
|
46,49fold
|
||||||
let h = winheight(0)
|
let h = winheight(0)
|
||||||
|
|
||||||
|
" Test for H, M and L commands
|
||||||
" Top of the screen = 30
|
" Top of the screen = 30
|
||||||
" Folded lines = 9
|
" Folded lines = 9
|
||||||
" Bottom of the screen = 30 + h + 9 - 1
|
" Bottom of the screen = 30 + h + 9 - 1
|
||||||
@ -771,10 +774,104 @@ func Test_scroll_cmds()
|
|||||||
call assert_equal(35 + h, line('.'))
|
call assert_equal(35 + h, line('.'))
|
||||||
normal! 4H
|
normal! 4H
|
||||||
call assert_equal(33, line('.'))
|
call assert_equal(33, line('.'))
|
||||||
|
|
||||||
|
" Test for the CTRL-E and CTRL-Y commands with folds
|
||||||
|
%d
|
||||||
|
call setline(1, range(1, 10))
|
||||||
|
3,5fold
|
||||||
|
exe "normal 6G3\<C-E>"
|
||||||
|
call assert_equal(6, line('w0'))
|
||||||
|
exe "normal 2\<C-Y>"
|
||||||
|
call assert_equal(2, line('w0'))
|
||||||
|
|
||||||
|
" Test for CTRL-Y on a folded line
|
||||||
|
%d
|
||||||
|
call setline(1, range(1, 100))
|
||||||
|
exe (h + 2) .. "," .. (h + 4) .. "fold"
|
||||||
|
exe h + 5
|
||||||
|
normal z-
|
||||||
|
exe "normal \<C-Y>\<C-Y>"
|
||||||
|
call assert_equal(h + 1, line('w$'))
|
||||||
|
|
||||||
|
" Using <PageUp> and <PageDown> in an empty buffer should beep
|
||||||
|
%d
|
||||||
|
call assert_beeps('exe "normal \<PageUp>"')
|
||||||
|
call assert_beeps('exe "normal \<C-B>"')
|
||||||
|
call assert_beeps('exe "normal \<PageDown>"')
|
||||||
|
call assert_beeps('exe "normal \<C-F>"')
|
||||||
|
|
||||||
|
" Test for <C-U> and <C-D> with fold
|
||||||
|
%d
|
||||||
|
call setline(1, range(1, 100))
|
||||||
|
10,35fold
|
||||||
|
set scroll=10
|
||||||
|
exe "normal \<C-D>"
|
||||||
|
call assert_equal(36, line('.'))
|
||||||
|
exe "normal \<C-D>"
|
||||||
|
call assert_equal(46, line('.'))
|
||||||
|
exe "normal \<C-U>"
|
||||||
|
call assert_equal(36, line('.'))
|
||||||
|
exe "normal \<C-U>"
|
||||||
|
call assert_equal(10, line('.'))
|
||||||
|
exe "normal \<C-U>"
|
||||||
|
call assert_equal(1, line('.'))
|
||||||
|
set scroll&
|
||||||
|
|
||||||
|
" Test for scrolling to the top of the file with <C-U> and a fold
|
||||||
|
10
|
||||||
|
normal ztL
|
||||||
|
exe "normal \<C-U>\<C-U>"
|
||||||
|
call assert_equal(1, line('w0'))
|
||||||
|
|
||||||
|
" Test for CTRL-D on a folded line
|
||||||
|
%d
|
||||||
|
call setline(1, range(1, 100))
|
||||||
|
50,100fold
|
||||||
|
75
|
||||||
|
normal z-
|
||||||
|
exe "normal \<C-D>"
|
||||||
|
call assert_equal(50, line('.'))
|
||||||
|
call assert_equal(100, line('w$'))
|
||||||
|
normal z.
|
||||||
|
let lnum = winline()
|
||||||
|
exe "normal \<C-D>"
|
||||||
|
call assert_equal(lnum, winline())
|
||||||
|
call assert_equal(50, line('.'))
|
||||||
|
normal zt
|
||||||
|
exe "normal \<C-D>"
|
||||||
|
call assert_equal(50, line('w0'))
|
||||||
|
|
||||||
set foldenable&
|
set foldenable&
|
||||||
close!
|
close!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for the 'sidescroll' option
|
||||||
|
func Test_sidescroll_opt()
|
||||||
|
new
|
||||||
|
20vnew
|
||||||
|
|
||||||
|
" scroll by 2 characters horizontally
|
||||||
|
set sidescroll=2 nowrap
|
||||||
|
call setline(1, repeat('a', 40))
|
||||||
|
normal g$l
|
||||||
|
call assert_equal(19, screenpos(0, 1, 21).col)
|
||||||
|
normal l
|
||||||
|
call assert_equal(20, screenpos(0, 1, 22).col)
|
||||||
|
normal g0h
|
||||||
|
call assert_equal(2, screenpos(0, 1, 2).col)
|
||||||
|
call assert_equal(20, screenpos(0, 1, 20).col)
|
||||||
|
|
||||||
|
" when 'sidescroll' is 0, cursor positioned at the center
|
||||||
|
set sidescroll=0
|
||||||
|
normal g$l
|
||||||
|
call assert_equal(11, screenpos(0, 1, 21).col)
|
||||||
|
normal g0h
|
||||||
|
call assert_equal(10, screenpos(0, 1, 10).col)
|
||||||
|
|
||||||
|
%bw!
|
||||||
|
set wrap& sidescroll&
|
||||||
|
endfunc
|
||||||
|
|
||||||
" basic tests for foldopen/folddelete
|
" basic tests for foldopen/folddelete
|
||||||
func Test_normal18_z_fold()
|
func Test_normal18_z_fold()
|
||||||
CheckFeature folding
|
CheckFeature folding
|
||||||
@ -2962,4 +3059,40 @@ func Test_normal_word_move()
|
|||||||
close!
|
close!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for 'scrolloff' with a long line that doesn't fit in the screen
|
||||||
|
func Test_normal_scroloff()
|
||||||
|
10new
|
||||||
|
80vnew
|
||||||
|
call setline(1, repeat('a', 1000))
|
||||||
|
set scrolloff=10
|
||||||
|
normal gg10gj
|
||||||
|
call assert_equal(8, winline())
|
||||||
|
normal 10gj
|
||||||
|
call assert_equal(10, winline())
|
||||||
|
normal 10gk
|
||||||
|
call assert_equal(3, winline())
|
||||||
|
set scrolloff&
|
||||||
|
close!
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Test for vertical scrolling with CTRL-F and CTRL-B with a long line
|
||||||
|
func Test_normal_vert_scroll_longline()
|
||||||
|
10new
|
||||||
|
80vnew
|
||||||
|
call setline(1, range(1, 10))
|
||||||
|
call append(5, repeat('a', 1000))
|
||||||
|
exe "normal gg\<C-F>"
|
||||||
|
call assert_equal(6, line('.'))
|
||||||
|
exe "normal \<C-F>\<C-F>"
|
||||||
|
call assert_equal(11, line('.'))
|
||||||
|
call assert_equal(1, winline())
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(10, line('.'))
|
||||||
|
call assert_equal(3, winline())
|
||||||
|
exe "normal \<C-B>\<C-B>"
|
||||||
|
call assert_equal(5, line('.'))
|
||||||
|
call assert_equal(5, winline())
|
||||||
|
close!
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -513,6 +513,7 @@ func Test_set_one_column()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_set_values()
|
func Test_set_values()
|
||||||
|
" opt_test.vim is generated from ../optiondefs.h using gen_opt_test.vim
|
||||||
if filereadable('opt_test.vim')
|
if filereadable('opt_test.vim')
|
||||||
source opt_test.vim
|
source opt_test.vim
|
||||||
else
|
else
|
||||||
@ -921,4 +922,35 @@ func Test_opt_boolean()
|
|||||||
set number&
|
set number&
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Test for the 'window' option
|
||||||
|
func Test_window_opt()
|
||||||
|
" Needs only one open widow
|
||||||
|
%bw!
|
||||||
|
call setline(1, range(1, 8))
|
||||||
|
set window=5
|
||||||
|
exe "normal \<C-F>"
|
||||||
|
call assert_equal(4, line('w0'))
|
||||||
|
exe "normal \<C-F>"
|
||||||
|
call assert_equal(7, line('w0'))
|
||||||
|
exe "normal \<C-F>"
|
||||||
|
call assert_equal(8, line('w0'))
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(5, line('w0'))
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(2, line('w0'))
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(1, line('w0'))
|
||||||
|
set window=1
|
||||||
|
exe "normal gg\<C-F>"
|
||||||
|
call assert_equal(2, line('w0'))
|
||||||
|
exe "normal \<C-F>"
|
||||||
|
call assert_equal(3, line('w0'))
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(2, line('w0'))
|
||||||
|
exe "normal \<C-B>"
|
||||||
|
call assert_equal(1, line('w0'))
|
||||||
|
enew!
|
||||||
|
set window&
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -488,10 +488,10 @@ func Xtest_browse(cchar)
|
|||||||
call assert_fails('Xprev', 'E553')
|
call assert_fails('Xprev', 'E553')
|
||||||
call assert_fails('Xpfile', 'E553')
|
call assert_fails('Xpfile', 'E553')
|
||||||
Xnfile
|
Xnfile
|
||||||
call assert_equal('Xqftestfile2', bufname('%'))
|
call assert_equal('Xqftestfile2', @%)
|
||||||
call assert_equal(10, line('.'))
|
call assert_equal(10, line('.'))
|
||||||
Xpfile
|
Xpfile
|
||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
call assert_equal(6, line('.'))
|
call assert_equal(6, line('.'))
|
||||||
5Xcc
|
5Xcc
|
||||||
call assert_equal(5, g:Xgetlist({'idx':0}).idx)
|
call assert_equal(5, g:Xgetlist({'idx':0}).idx)
|
||||||
@ -507,7 +507,7 @@ func Xtest_browse(cchar)
|
|||||||
call assert_equal(6, g:Xgetlist({'idx':0}).idx)
|
call assert_equal(6, g:Xgetlist({'idx':0}).idx)
|
||||||
Xlast
|
Xlast
|
||||||
Xprev
|
Xprev
|
||||||
call assert_equal('Xqftestfile2', bufname('%'))
|
call assert_equal('Xqftestfile2', @%)
|
||||||
call assert_equal(11, line('.'))
|
call assert_equal(11, line('.'))
|
||||||
call assert_fails('Xnext', 'E553')
|
call assert_fails('Xnext', 'E553')
|
||||||
call assert_fails('Xnfile', 'E553')
|
call assert_fails('Xnfile', 'E553')
|
||||||
@ -520,14 +520,14 @@ func Xtest_browse(cchar)
|
|||||||
endif
|
endif
|
||||||
call assert_equal(6, g:Xgetlist({'idx':0}).idx)
|
call assert_equal(6, g:Xgetlist({'idx':0}).idx)
|
||||||
Xrewind
|
Xrewind
|
||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
|
|
||||||
10Xnext
|
10Xnext
|
||||||
call assert_equal('Xqftestfile2', bufname('%'))
|
call assert_equal('Xqftestfile2', @%)
|
||||||
call assert_equal(11, line('.'))
|
call assert_equal(11, line('.'))
|
||||||
10Xprev
|
10Xprev
|
||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
|
|
||||||
" Jumping to an error from the error window using cc command
|
" Jumping to an error from the error window using cc command
|
||||||
@ -538,7 +538,7 @@ func Xtest_browse(cchar)
|
|||||||
Xopen
|
Xopen
|
||||||
10Xcc
|
10Xcc
|
||||||
call assert_equal(11, line('.'))
|
call assert_equal(11, line('.'))
|
||||||
call assert_equal('Xqftestfile2', bufname('%'))
|
call assert_equal('Xqftestfile2', @%)
|
||||||
Xopen
|
Xopen
|
||||||
call cursor(2, 1)
|
call cursor(2, 1)
|
||||||
if a:cchar == 'c'
|
if a:cchar == 'c'
|
||||||
@ -547,14 +547,14 @@ func Xtest_browse(cchar)
|
|||||||
.ll
|
.ll
|
||||||
endif
|
endif
|
||||||
call assert_equal(6, line('.'))
|
call assert_equal(6, line('.'))
|
||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
|
|
||||||
" Jumping to an error from the error window (when only the error window is
|
" Jumping to an error from the error window (when only the error window is
|
||||||
" present)
|
" present)
|
||||||
Xopen | only
|
Xopen | only
|
||||||
Xlast 1
|
Xlast 1
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
call assert_equal('Xqftestfile1', bufname('%'))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
|
|
||||||
Xexpr ""
|
Xexpr ""
|
||||||
call assert_fails('Xnext', 'E42:')
|
call assert_fails('Xnext', 'E42:')
|
||||||
@ -1859,7 +1859,7 @@ func Test_switchbuf()
|
|||||||
copen | only
|
copen | only
|
||||||
cfirst
|
cfirst
|
||||||
call assert_equal(1, tabpagenr())
|
call assert_equal(1, tabpagenr())
|
||||||
call assert_equal('Xqftestfile1', bufname(''))
|
call assert_equal('Xqftestfile1', @%)
|
||||||
|
|
||||||
" If opening a file changes 'switchbuf', then the new value should be
|
" If opening a file changes 'switchbuf', then the new value should be
|
||||||
" retained.
|
" retained.
|
||||||
@ -2679,7 +2679,7 @@ func Test_cwindow_jump()
|
|||||||
wincmd b
|
wincmd b
|
||||||
cfirst
|
cfirst
|
||||||
call assert_equal(2, winnr())
|
call assert_equal(2, winnr())
|
||||||
call assert_equal('F1', bufname(''))
|
call assert_equal('F1', @%)
|
||||||
enew | only
|
enew | only
|
||||||
exe 'sb' bnum
|
exe 'sb' bnum
|
||||||
exe 'botright sb' bnum
|
exe 'botright sb' bnum
|
||||||
@ -2768,7 +2768,7 @@ func XvimgrepTests(cchar)
|
|||||||
edit +3 Xtestfile2
|
edit +3 Xtestfile2
|
||||||
Xvimgrep +\cemacs+j Xtestfile1
|
Xvimgrep +\cemacs+j Xtestfile1
|
||||||
let l = g:Xgetlist()
|
let l = g:Xgetlist()
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal('Editor:Emacs EmAcS', l[0].text)
|
call assert_equal('Editor:Emacs EmAcS', l[0].text)
|
||||||
|
|
||||||
" Test for unloading a buffer after vimgrep searched the buffer
|
" Test for unloading a buffer after vimgrep searched the buffer
|
||||||
@ -3394,7 +3394,7 @@ func Xqfjump_tests(cchar)
|
|||||||
Xopen | only
|
Xopen | only
|
||||||
2Xnext
|
2Xnext
|
||||||
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
|
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
|
||||||
call assert_equal('F3', bufname('%'))
|
call assert_equal('F3', @%)
|
||||||
Xnext
|
Xnext
|
||||||
call assert_equal(7, col('.'))
|
call assert_equal(7, col('.'))
|
||||||
Xnext
|
Xnext
|
||||||
@ -4043,20 +4043,20 @@ func Xjumpto_first_error_test(cchar)
|
|||||||
" Test for cexpr/lexpr
|
" Test for cexpr/lexpr
|
||||||
enew
|
enew
|
||||||
Xexpr l
|
Xexpr l
|
||||||
call assert_equal('Xtestfile1', bufname(''))
|
call assert_equal('Xtestfile1', @%)
|
||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
|
|
||||||
" Test for cfile/lfile
|
" Test for cfile/lfile
|
||||||
enew
|
enew
|
||||||
call writefile(l, 'Xerr')
|
call writefile(l, 'Xerr')
|
||||||
Xfile Xerr
|
Xfile Xerr
|
||||||
call assert_equal('Xtestfile1', bufname(''))
|
call assert_equal('Xtestfile1', @%)
|
||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
|
|
||||||
" Test for cbuffer/lbuffer
|
" Test for cbuffer/lbuffer
|
||||||
edit Xerr
|
edit Xerr
|
||||||
Xbuffer
|
Xbuffer
|
||||||
call assert_equal('Xtestfile1', bufname(''))
|
call assert_equal('Xtestfile1', @%)
|
||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
|
|
||||||
call delete('Xerr')
|
call delete('Xerr')
|
||||||
@ -4081,7 +4081,7 @@ func Xautocmd_changelist(cchar)
|
|||||||
autocmd QuickFixCmdPost * Xolder
|
autocmd QuickFixCmdPost * Xolder
|
||||||
call writefile(['Xtestfile2:4:Line4'], 'Xerr')
|
call writefile(['Xtestfile2:4:Line4'], 'Xerr')
|
||||||
Xfile Xerr
|
Xfile Xerr
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal(4, line('.'))
|
call assert_equal(4, line('.'))
|
||||||
autocmd! QuickFixCmdPost
|
autocmd! QuickFixCmdPost
|
||||||
|
|
||||||
@ -4092,7 +4092,7 @@ func Xautocmd_changelist(cchar)
|
|||||||
call writefile(['Xtestfile2:4:Line4'], 'Xerr')
|
call writefile(['Xtestfile2:4:Line4'], 'Xerr')
|
||||||
edit Xerr
|
edit Xerr
|
||||||
Xbuffer
|
Xbuffer
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal(4, line('.'))
|
call assert_equal(4, line('.'))
|
||||||
autocmd! QuickFixCmdPost
|
autocmd! QuickFixCmdPost
|
||||||
|
|
||||||
@ -4101,7 +4101,7 @@ func Xautocmd_changelist(cchar)
|
|||||||
Xexpr 'Xtestfile1:2:Line2'
|
Xexpr 'Xtestfile1:2:Line2'
|
||||||
autocmd QuickFixCmdPost * Xolder
|
autocmd QuickFixCmdPost * Xolder
|
||||||
Xexpr 'Xtestfile2:4:Line4'
|
Xexpr 'Xtestfile2:4:Line4'
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal(4, line('.'))
|
call assert_equal(4, line('.'))
|
||||||
autocmd! QuickFixCmdPost
|
autocmd! QuickFixCmdPost
|
||||||
|
|
||||||
@ -4112,7 +4112,7 @@ func Xautocmd_changelist(cchar)
|
|||||||
Xexpr 'Xtestfile1:2:Line2'
|
Xexpr 'Xtestfile1:2:Line2'
|
||||||
autocmd QuickFixCmdPost * Xolder
|
autocmd QuickFixCmdPost * Xolder
|
||||||
silent Xgrep Line5 Xtestfile2
|
silent Xgrep Line5 Xtestfile2
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
autocmd! QuickFixCmdPost
|
autocmd! QuickFixCmdPost
|
||||||
endif
|
endif
|
||||||
@ -4122,7 +4122,7 @@ func Xautocmd_changelist(cchar)
|
|||||||
Xexpr 'Xtestfile1:2:Line2'
|
Xexpr 'Xtestfile1:2:Line2'
|
||||||
autocmd QuickFixCmdPost * Xolder
|
autocmd QuickFixCmdPost * Xolder
|
||||||
silent Xvimgrep Line5 Xtestfile2
|
silent Xvimgrep Line5 Xtestfile2
|
||||||
call assert_equal('Xtestfile2', bufname(''))
|
call assert_equal('Xtestfile2', @%)
|
||||||
call assert_equal(5, line('.'))
|
call assert_equal(5, line('.'))
|
||||||
autocmd! QuickFixCmdPost
|
autocmd! QuickFixCmdPost
|
||||||
|
|
||||||
@ -4415,7 +4415,7 @@ func Test_winonly_autocmd()
|
|||||||
" positioned correctly.
|
" positioned correctly.
|
||||||
ll 3
|
ll 3
|
||||||
call assert_equal(loclistid, getloclist(0, {'id' : 0}).id)
|
call assert_equal(loclistid, getloclist(0, {'id' : 0}).id)
|
||||||
call assert_equal('Xtest1', bufname(''))
|
call assert_equal('Xtest1', @%)
|
||||||
call assert_equal(15, line('.'))
|
call assert_equal(15, line('.'))
|
||||||
" Cleanup
|
" Cleanup
|
||||||
autocmd! WinEnter
|
autocmd! WinEnter
|
||||||
@ -4476,51 +4476,51 @@ func Xtest_below(cchar)
|
|||||||
Xexpr ["X1:5:3:L5", "X2:5:2:L5", "X2:10:3:L10", "X2:15:4:L15", "X3:3:5:L3"]
|
Xexpr ["X1:5:3:L5", "X2:5:2:L5", "X2:10:3:L10", "X2:15:4:L15", "X3:3:5:L3"]
|
||||||
edit +7 X2
|
edit +7 X2
|
||||||
Xabove
|
Xabove
|
||||||
call assert_equal(['X2', 5], [bufname(''), line('.')])
|
call assert_equal(['X2', 5], [@%, line('.')])
|
||||||
call assert_fails('Xabove', 'E553:')
|
call assert_fails('Xabove', 'E553:')
|
||||||
normal 7G
|
normal 7G
|
||||||
Xbefore
|
Xbefore
|
||||||
call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
|
||||||
call assert_fails('Xbefore', 'E553:')
|
call assert_fails('Xbefore', 'E553:')
|
||||||
|
|
||||||
normal 2j
|
normal 2j
|
||||||
Xbelow
|
Xbelow
|
||||||
call assert_equal(['X2', 10], [bufname(''), line('.')])
|
call assert_equal(['X2', 10], [@%, line('.')])
|
||||||
normal 7G
|
normal 7G
|
||||||
Xafter
|
Xafter
|
||||||
call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
" Last error in this file
|
" Last error in this file
|
||||||
Xbelow 99
|
Xbelow 99
|
||||||
call assert_equal(['X2', 15], [bufname(''), line('.')])
|
call assert_equal(['X2', 15], [@%, line('.')])
|
||||||
call assert_fails('Xbelow', 'E553:')
|
call assert_fails('Xbelow', 'E553:')
|
||||||
normal gg
|
normal gg
|
||||||
Xafter 99
|
Xafter 99
|
||||||
call assert_equal(['X2', 15, 4], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 4], [@%, line('.'), col('.')])
|
||||||
call assert_fails('Xafter', 'E553:')
|
call assert_fails('Xafter', 'E553:')
|
||||||
|
|
||||||
" First error in this file
|
" First error in this file
|
||||||
Xabove 99
|
Xabove 99
|
||||||
call assert_equal(['X2', 5], [bufname(''), line('.')])
|
call assert_equal(['X2', 5], [@%, line('.')])
|
||||||
call assert_fails('Xabove', 'E553:')
|
call assert_fails('Xabove', 'E553:')
|
||||||
normal G
|
normal G
|
||||||
Xbefore 99
|
Xbefore 99
|
||||||
call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
|
||||||
call assert_fails('Xbefore', 'E553:')
|
call assert_fails('Xbefore', 'E553:')
|
||||||
|
|
||||||
normal gg
|
normal gg
|
||||||
Xbelow 2
|
Xbelow 2
|
||||||
call assert_equal(['X2', 10], [bufname(''), line('.')])
|
call assert_equal(['X2', 10], [@%, line('.')])
|
||||||
normal gg
|
normal gg
|
||||||
Xafter 2
|
Xafter 2
|
||||||
call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal G
|
normal G
|
||||||
Xabove 2
|
Xabove 2
|
||||||
call assert_equal(['X2', 10], [bufname(''), line('.')])
|
call assert_equal(['X2', 10], [@%, line('.')])
|
||||||
normal G
|
normal G
|
||||||
Xbefore 2
|
Xbefore 2
|
||||||
call assert_equal(['X2', 10, 3], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 3], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
edit X4
|
edit X4
|
||||||
call assert_fails('Xabove', 'E42:')
|
call assert_fails('Xabove', 'E42:')
|
||||||
@ -4544,45 +4544,45 @@ func Xtest_below(cchar)
|
|||||||
\ "X2:15:1:L15_1", "X2:15:2:L15_2", "X2:15:3:L15_3", "X3:3:L3"]
|
\ "X2:15:1:L15_1", "X2:15:2:L15_2", "X2:15:3:L15_3", "X3:3:L3"]
|
||||||
edit +1 X2
|
edit +1 X2
|
||||||
Xbelow 2
|
Xbelow 2
|
||||||
call assert_equal(['X2', 10, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 1], [@%, line('.'), col('.')])
|
||||||
normal 1G
|
normal 1G
|
||||||
Xafter 2
|
Xafter 2
|
||||||
call assert_equal(['X2', 5, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 2], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal gg
|
normal gg
|
||||||
Xbelow 99
|
Xbelow 99
|
||||||
call assert_equal(['X2', 15, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 1], [@%, line('.'), col('.')])
|
||||||
normal gg
|
normal gg
|
||||||
Xafter 99
|
Xafter 99
|
||||||
call assert_equal(['X2', 15, 3], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 3], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal G
|
normal G
|
||||||
Xabove 2
|
Xabove 2
|
||||||
call assert_equal(['X2', 10, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 1], [@%, line('.'), col('.')])
|
||||||
normal G
|
normal G
|
||||||
Xbefore 2
|
Xbefore 2
|
||||||
call assert_equal(['X2', 15, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 2], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal G
|
normal G
|
||||||
Xabove 99
|
Xabove 99
|
||||||
call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
|
||||||
normal G
|
normal G
|
||||||
Xbefore 99
|
Xbefore 99
|
||||||
call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal 10G
|
normal 10G
|
||||||
Xabove
|
Xabove
|
||||||
call assert_equal(['X2', 5, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 5, 1], [@%, line('.'), col('.')])
|
||||||
normal 10G$
|
normal 10G$
|
||||||
2Xbefore
|
2Xbefore
|
||||||
call assert_equal(['X2', 10, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 10, 2], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
normal 10G
|
normal 10G
|
||||||
Xbelow
|
Xbelow
|
||||||
call assert_equal(['X2', 15, 1], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 1], [@%, line('.'), col('.')])
|
||||||
normal 9G
|
normal 9G
|
||||||
5Xafter
|
5Xafter
|
||||||
call assert_equal(['X2', 15, 2], [bufname(''), line('.'), col('.')])
|
call assert_equal(['X2', 15, 2], [@%, line('.'), col('.')])
|
||||||
|
|
||||||
" Invalid range
|
" Invalid range
|
||||||
if a:cchar == 'c'
|
if a:cchar == 'c'
|
||||||
|
@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
1040,
|
||||||
/**/
|
/**/
|
||||||
1039,
|
1039,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user