From 86330fdd3f39a8975b25b7050a3d02b77a442057 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 10 Jan 2015 20:27:17 -0300 Subject: vim-patch:7.4.530-531 Specify different kinds of counts for commands. Updated ex commands generator scripts. Includes fixes to comments from patch 7.4.531 Original message: Problem: Many commands take a count or range that is not using line numbers. Solution: For each command specify what kind of count it uses. For windows, buffers and arguments have "$" and "." have a relevant meaning. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?r=v7-4-530 https://code.google.com/p/vim/source/detail?r=v7-4-531 Add legacy tests for 7.4.530 https://code.google.com/p/vim/source/detail?r=1e6d87a36dcdca231721dde8cbbc26610fb3df27 --- src/nvim/testdir/Makefile | 4 +- src/nvim/testdir/test_argument_count.in | 47 ++++++++++ src/nvim/testdir/test_argument_count.ok | 13 +++ src/nvim/testdir/test_close_count.in | 156 ++++++++++++++++++++++++++++++++ src/nvim/testdir/test_close_count.ok | 23 +++++ 5 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 src/nvim/testdir/test_argument_count.in create mode 100644 src/nvim/testdir/test_argument_count.ok create mode 100644 src/nvim/testdir/test_close_count.in create mode 100644 src/nvim/testdir/test_close_count.ok (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index 0a7c16e2cb..fb529e0cb2 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -29,7 +29,9 @@ SCRIPTS := test_autoformat_join.out \ test86.out test87.out test88.out \ test96.out \ test_listlbr.out \ - test_breakindent.out + test_breakindent.out \ + test_argument_count.out \ + test_close_count.out SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test_argument_count.in b/src/nvim/testdir/test_argument_count.in new file mode 100644 index 0000000000..f45e52a3e6 --- /dev/null +++ b/src/nvim/testdir/test_argument_count.in @@ -0,0 +1,47 @@ +Tests for :[count]argument! and :[count]argdelete vim: set ft=vim : + +STARTTEST +:%argd +:argadd a b c d +:set hidden +:let buffers = [] +:augroup TEST +:au BufEnter * call add(buffers, expand('%:t')) +:augroup END +:$argu +:$-argu +:-argu +:1argu +:+2argu +:augroup TEST +:au! +:augroup END +:let arglists = [] +:.argd +:call add(arglists, argv()) +:-argd +:call add(arglists, argv()) +:$argd +:call add(arglists, argv()) +:1arga c +:1arga b +:$argu +:+arga d +:$arga x +:call add(arglists, argv()) +:$-10arga Y +:call add(arglists, argv()) +:%argd +:call add(arglists, argv()) +:arga a b c d e f +:2,$-argd +:call add(arglists, argv()) +:e! test.out +:call append(0, buffers) +:let lnr = line('$') +:call append(lnr, map(copy(arglists), 'join(v:val, " ")')) +:w +:qa! +ENDTEST + + diff --git a/src/nvim/testdir/test_argument_count.ok b/src/nvim/testdir/test_argument_count.ok new file mode 100644 index 0000000000..f591bf2614 --- /dev/null +++ b/src/nvim/testdir/test_argument_count.ok @@ -0,0 +1,13 @@ +d +c +b +a +c + +a b d +a d +a +a b c d x +Y a b c d x + +a f diff --git a/src/nvim/testdir/test_close_count.in b/src/nvim/testdir/test_close_count.in new file mode 100644 index 0000000000..288945c696 --- /dev/null +++ b/src/nvim/testdir/test_close_count.in @@ -0,0 +1,156 @@ +Tests for :[count]close! and :[count]hide vim: set ft=vim : + +STARTTEST +:let tests = [] +:so tiny.vim +:for i in range(5) +:new +:endfor +:4wincmd w +:close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:$close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +:2close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +:new +:new +:2wincmd w +:-2close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:2wincmd w +:+1close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:e! test.out +:call append(0, map(copy(tests), 'join(v:val, " ")')) +:w +:only! +:b1 +ENDTEST + +STARTTEST +:let tests = [] +:so tiny.vim +:for i in range(5) +:new +:endfor +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:4wincmd w +:.hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:9hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +:2hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +:new +:new +:3wincmd w +:-hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:2wincmd w +:+hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:e! test.out +:call append(line('$'), map(copy(tests), 'join(v:val, " ")')) +Go +:w +:only! +:b1 +ENDTEST + +STARTTEST +:let tests = [] +:so tiny.vim +:set hidden +:for i in range(5) +:new +:endfor +:1wincmd w +:$ hide +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:$-1 close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +:.+close! +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:e! test.out +:call append(line('$'), map(copy(tests), 'join(v:val, " ")')) +Go +:w +:only! +:b1 +ENDTEST + +STARTTEST +:let tests = [] +:so tiny.vim +:set hidden +:for i in range(5) +:new +:endfor +:4wincmd w +c +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +1c +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +9c +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:1wincmd w +2c +:let buffers = [] +:windo call add(buffers, bufnr('%')) +:call add(tests, buffers) +:only! +:e! test.out +:call append(line('$'), map(copy(tests), 'join(v:val, " ")')) +:w +:qa! +ENDTEST + + diff --git a/src/nvim/testdir/test_close_count.ok b/src/nvim/testdir/test_close_count.ok new file mode 100644 index 0000000000..1cee870487 --- /dev/null +++ b/src/nvim/testdir/test_close_count.ok @@ -0,0 +1,23 @@ +6 5 4 2 1 +5 4 2 1 +5 4 2 +5 2 +7 5 2 +7 5 + +13 12 11 10 9 1 +13 12 11 9 1 +12 11 9 1 +12 11 9 +12 9 +15 12 9 +15 12 + +20 19 18 17 16 +20 19 18 16 +20 18 16 + +25 24 23 21 1 +24 23 21 1 +24 23 21 +24 21 -- cgit From 7fc952ab67afdfef5ba2a90cb277b30ce573333c Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Thu, 15 Jan 2015 20:18:15 -0300 Subject: vim-patch:7.4.542 Problem: Using a range for window and buffer commands has a few problems. Cannot specify the type of range for a user command. Solution: Add the -addr argument for user commands. Fix problems. (Marcin Szamotulski https://code.google.com/p/vim/source/detail?name=v7-4-542 --- src/nvim/testdir/Makefile | 3 +- src/nvim/testdir/test_command_count.in | 50 ++++++++++++++++++++++++++++++++++ src/nvim/testdir/test_command_count.ok | 17 ++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/nvim/testdir/test_command_count.in create mode 100644 src/nvim/testdir/test_command_count.ok (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index fb529e0cb2..fa68ab8d3a 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -31,7 +31,8 @@ SCRIPTS := test_autoformat_join.out \ test_listlbr.out \ test_breakindent.out \ test_argument_count.out \ - test_close_count.out + test_close_count.out \ + test_command_count.out SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in new file mode 100644 index 0000000000..3697add746 --- /dev/null +++ b/src/nvim/testdir/test_command_count.in @@ -0,0 +1,50 @@ +Test for user command counts vim: set ft=vim : + +STARTTEST +:let g:lines = [] +:so tiny.vim +:com -range RangeLines :call add(g:lines, 'RangeLines '..' '.) +:com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '..' '.) +:com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '..' '.) +:com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '..' '.) +:com -range=% -addr=loaded_buffers RangeLoadedBuffersAll :call add(g:lines, 'RangeLoadedBuffersAll '..' '.) +:com -range -addr=buffers RangeBuffers :call add(g:lines, 'RangeBuffers '..' '.) +:com -range=% -addr=buffers RangeBuffersAll :call add(g:lines, 'RangeBuffersAll '..' '.) +:com -range -addr=windows RangeWindows :call add(g:lines, 'RangeWindows '..' '.) +:com -range=% -addr=windows RangeWindowsAll :call add(g:lines, 'RangeWindowsAll '..' '.) +:com -range -addr=tabs RangeTabs :call add(g:lines, 'RangeTabs '..' '.) +:com -range=% -addr=tabs RangeTabsAll :call add(g:lines, 'RangeTabsAll '..' '.) +:set hidden +:arga a b c d +:argdo echo "loading buffers" +:argu 3 +:.-,$-RangeArguments +:%RangeArguments +:RangeArgumentsAll +:N +:.RangeArguments +:split|split|split|split +:3wincmd w +:.,$RangeWindows +:%RangeWindows +:RangeWindowsAll +:only +:blast|bd +:.,$RangeLoadedBuffers +:%RangeLoadedBuffers +:RangeLoadedBuffersAll +:.,$RangeBuffers +:%RangeBuffers +:RangeBuffersAll +:tabe|tabe|tabe|tabe +:normal 2gt +:.,$RangeTabs +:%RangeTabs +:RangeTabsAll +:1tabonly +:e! test.out +:call append(0, g:lines) +:w|qa! +ENDTEST + + diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok new file mode 100644 index 0000000000..11e88b3903 --- /dev/null +++ b/src/nvim/testdir/test_command_count.ok @@ -0,0 +1,17 @@ +RangeArguments 2 4 +RangeArguments 1 5 +RangeArgumentsAll 1 5 +RangeArguments 2 2 +RangeWindows 3 5 +RangeWindows 1 5 +RangeWindowsAll 1 5 +RangeLoadedBuffers 2 4 +RangeLoadedBuffers 1 4 +RangeLoadedBuffersAll 1 4 +RangeBuffers 2 5 +RangeBuffers 1 5 +RangeBuffersAll 1 5 +RangeTabs 2 5 +RangeTabs 1 5 +RangeTabsAll 1 5 + -- cgit From d2ad709a1e8eb9674e2744015cb609e941ea78f1 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Thu, 15 Jan 2015 18:33:02 -0300 Subject: vim-patch:7.4.561 Patch 7.4.561 Problem: Ex range handling is wrong for buffer-local user commands. Solution: Check for CMD_USER_BUF. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?name=v7-4-561 --- src/nvim/testdir/test_command_count.in | 8 +++++++- src/nvim/testdir/test_command_count.ok | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in index 3697add746..c71ae5a386 100644 --- a/src/nvim/testdir/test_command_count.in +++ b/src/nvim/testdir/test_command_count.in @@ -3,7 +3,7 @@ Test for user command counts vim: set ft=vim : STARTTEST :let g:lines = [] :so tiny.vim -:com -range RangeLines :call add(g:lines, 'RangeLines '..' '.) +:com -range=% RangeLines :call add(g:lines, 'RangeLines '..' '.) :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '..' '.) :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '..' '.) :com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '..' '.) @@ -42,6 +42,12 @@ STARTTEST :%RangeTabs :RangeTabsAll :1tabonly +:s/\n/\r\r\r\r\r/ +:2ma< +:$-ma> +:'<,'>RangeLines +:com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '..' '.) +:'<,'>LocalRangeLines :e! test.out :call append(0, g:lines) :w|qa! diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok index 11e88b3903..693a22d63f 100644 --- a/src/nvim/testdir/test_command_count.ok +++ b/src/nvim/testdir/test_command_count.ok @@ -14,4 +14,6 @@ RangeBuffersAll 1 5 RangeTabs 2 5 RangeTabs 1 5 RangeTabsAll 1 5 +RangeLines 2 5 +LocalRangeLines 2 5 -- cgit From ca883df007d7644a0ff4986d564ee8524f88c86b Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Tue, 20 Jan 2015 00:28:37 -0300 Subject: vim-patch:7.4.565 Problem: Ranges for arguments, buffers, tabs, etc. are not checked to be valid but limited to the maximum. This can cause the wrong thing to happen. Solution: Give an error for an invalid value. (Marcin Szamotulski) Use windows range for ":wincmd". https://code.google.com/p/vim/source/detail?r=v7-4-565 --- src/nvim/testdir/test62.in | 2 +- src/nvim/testdir/test_argument_count.in | 3 +-- src/nvim/testdir/test_argument_count.ok | 4 ++-- src/nvim/testdir/test_close_count.in | 4 ++-- src/nvim/testdir/test_command_count.in | 42 ++++++++++++++++++++++++++++++++- src/nvim/testdir/test_command_count.ok | 11 +++++++++ 6 files changed, 58 insertions(+), 8 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test62.in b/src/nvim/testdir/test62.in index 93d968b33e..c201fe7137 100644 --- a/src/nvim/testdir/test62.in +++ b/src/nvim/testdir/test62.in @@ -13,7 +13,7 @@ STARTTEST :" Open three tab pages and use ":tabdo" :0tabnew :1tabnew -:888tabnew +:$tabnew :tabdo call append(line('$'), 'this is tab page ' . tabpagenr()) :tabclose! 2 :tabrewind diff --git a/src/nvim/testdir/test_argument_count.in b/src/nvim/testdir/test_argument_count.in index f45e52a3e6..af91f38375 100644 --- a/src/nvim/testdir/test_argument_count.in +++ b/src/nvim/testdir/test_argument_count.in @@ -26,10 +26,9 @@ STARTTEST :1arga c :1arga b :$argu -:+arga d :$arga x :call add(arglists, argv()) -:$-10arga Y +:0arga Y :call add(arglists, argv()) :%argd :call add(arglists, argv()) diff --git a/src/nvim/testdir/test_argument_count.ok b/src/nvim/testdir/test_argument_count.ok index f591bf2614..f51562620d 100644 --- a/src/nvim/testdir/test_argument_count.ok +++ b/src/nvim/testdir/test_argument_count.ok @@ -7,7 +7,7 @@ c a b d a d a -a b c d x -Y a b c d x +a b c x +Y a b c x a f diff --git a/src/nvim/testdir/test_close_count.in b/src/nvim/testdir/test_close_count.in index 288945c696..58dfb425ce 100644 --- a/src/nvim/testdir/test_close_count.in +++ b/src/nvim/testdir/test_close_count.in @@ -28,7 +28,7 @@ STARTTEST :new :new :2wincmd w -:-2close! +:-1close! :let buffers = [] :windo call add(buffers, bufnr('%')) :call add(tests, buffers) @@ -62,7 +62,7 @@ STARTTEST :let buffers = [] :windo call add(buffers, bufnr('%')) :call add(tests, buffers) -:9hide +:$hide :let buffers = [] :windo call add(buffers, bufnr('%')) :call add(tests, buffers) diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in index c71ae5a386..e7dadd2bed 100644 --- a/src/nvim/testdir/test_command_count.in +++ b/src/nvim/testdir/test_command_count.in @@ -1,8 +1,8 @@ Test for user command counts vim: set ft=vim : STARTTEST -:let g:lines = [] :so tiny.vim +:let g:lines = [] :com -range=% RangeLines :call add(g:lines, 'RangeLines '..' '.) :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '..' '.) :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '..' '.) @@ -48,6 +48,46 @@ STARTTEST :'<,'>RangeLines :com -range=% -buffer LocalRangeLines :call add(g:lines, 'LocalRangeLines '..' '.) :'<,'>LocalRangeLines +:b1 +ENDTEST + +STARTTEST +:call add(g:lines, '') +:%argd +:arga a b c d +:let v:errmsg = '' +:5argu +:call add(g:lines, '5argu ' . v:errmsg) +:$argu +:call add(g:lines, '4argu ' . expand('%:t')) +:let v:errmsg = '' +:1argu +:call add(g:lines, '1argu ' . expand('%:t')) +:let v:errmsg = '' +:100b +:call add(g:lines, '100b ' . v:errmsg) +:split|split|split|split +:let v:errmsg = '' +:0close +:call add(g:lines, '0close ' . v:errmsg) +:$wincmd w +:$close +:call add(g:lines, '$close ' . winnr()) +:let v:errmsg = '' +:$+close +:call add(g:lines, '$+close ' . v:errmsg) +:$tabe +:call add(g:lines, '$tabe ' . tabpagenr()) +:let v:errmsg = '' +:$+tabe +:call add(g:lines, '$+tabe ' . v:errmsg) +:only! +:e x +:0tabm +:normal 1gt +:call add(g:lines, '0tabm ' . expand('%:t')) +:tabonly! +:only! :e! test.out :call append(0, g:lines) :w|qa! diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok index 693a22d63f..6e85f29d94 100644 --- a/src/nvim/testdir/test_command_count.ok +++ b/src/nvim/testdir/test_command_count.ok @@ -17,3 +17,14 @@ RangeTabsAll 1 5 RangeLines 2 5 LocalRangeLines 2 5 +5argu E16: Invalid range +4argu d +1argu a +100b E16: Invalid range +0close E16: Invalid range +$close 4 +$+close E16: Invalid range +$tabe 2 +$+tabe E16: Invalid range +0tabm x + -- cgit From ff70129d96f44dcb773e6ce56bc824a04ba5d9a9 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Tue, 20 Jan 2015 01:02:35 -0300 Subject: vim-patch:7.4.566 Problem: :argdo, :bufdo, :windo and :tabdo don't take a range. Solution: Support the range. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?r=v7-4-566 --- src/nvim/testdir/test_command_count.in | 34 ++++++++++++++++++++++++++++++++++ src/nvim/testdir/test_command_count.ok | 5 +++++ 2 files changed, 39 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in index e7dadd2bed..16daad0b2d 100644 --- a/src/nvim/testdir/test_command_count.in +++ b/src/nvim/testdir/test_command_count.in @@ -90,6 +90,40 @@ STARTTEST :only! :e! test.out :call append(0, g:lines) +:unlet g:lines +:w|bd +:se hidden +:b1 +ENDTEST + +STARTTEST +:only! +:let g:lines = [] +:%argd +:arga a b c d e f +:3argu +:let args = '' +:.,$-argdo let args .= ' '.expand('%') +:call add(g:lines, 'argdo:' . args) +:split|split|split|split +:2wincmd w +:let windows = '' +:.,$-windo let windows .= ' '.winnr() +:call add(g:lines, 'windo:'. windows) +:b2 +:let buffers = '' +:.,$-bufdo let buffers .= ' '.bufnr('%') +:call add(g:lines, 'bufdo:' . buffers) +:let buffers = '' +:3,7bufdo let buffers .= ' '.bufnr('%') +:call add(g:lines, 'bufdo:' . buffers) +:tabe|tabe|tabe|tabe +:normal! 2gt +:let tabpages = '' +:.,$-tabdo let tabpages .= ' '.tabpagenr() +:call add(g:lines, 'tabdo:' . tabpages) +:e! test.out +:call append('$', g:lines) :w|qa! ENDTEST diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok index 6e85f29d94..a936715b36 100644 --- a/src/nvim/testdir/test_command_count.ok +++ b/src/nvim/testdir/test_command_count.ok @@ -28,3 +28,8 @@ $tabe 2 $+tabe E16: Invalid range 0tabm x +argdo: c d e +windo: 2 3 4 +bufdo: 2 3 4 5 6 7 8 9 10 12 +bufdo: 3 4 5 6 7 +tabdo: 2 3 4 -- cgit From e42b00dc3b7fb86a3f6ca2a91c0b9cd6569bed60 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Tue, 20 Jan 2015 01:17:37 -0300 Subject: vim-patch:7.4.568 Problem: Giving an error for ":0wincmd w" is a problem for some plugins. Solution: Allow the zero in the range. (Marcin Szamotulski) https://code.google.com/p/vim/source/detail?r=v7-4-568 --- src/nvim/testdir/test_command_count.ok | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok index a936715b36..7219b28e16 100644 --- a/src/nvim/testdir/test_command_count.ok +++ b/src/nvim/testdir/test_command_count.ok @@ -21,8 +21,8 @@ LocalRangeLines 2 5 4argu d 1argu a 100b E16: Invalid range -0close E16: Invalid range -$close 4 +0close +$close 3 $+close E16: Invalid range $tabe 2 $+tabe E16: Invalid range -- cgit From 7e850a2f2aafa609457b9d6f6f637449d4113567 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Tue, 20 Jan 2015 11:10:54 -0300 Subject: vim-patch:7.4.585 Problem: Range for :bdelete does not work. (Ronald Schild) Solution: Also allow unloaded buffers. https://code.google.com/p/vim/source/detail?name=v7-4-585 --- src/nvim/testdir/test_command_count.in | 28 +++++++++++++++++++++++++++- src/nvim/testdir/test_command_count.ok | 7 +++++-- 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in index 16daad0b2d..284110a4ec 100644 --- a/src/nvim/testdir/test_command_count.in +++ b/src/nvim/testdir/test_command_count.in @@ -92,11 +92,37 @@ STARTTEST :call append(0, g:lines) :unlet g:lines :w|bd -:se hidden :b1 ENDTEST STARTTEST +:let g:lines = [] +:func BufStatus() +: call add(g:lines, 'aaa: ' . buflisted(g:buf_aaa) . ' bbb: ' . buflisted(g:buf_bbb) . ' ccc: ' . buflisted(g:buf_ccc)) +:endfunc +:se nohidden +:e aaa +:let buf_aaa = bufnr('%') +:e bbb +:let buf_bbb = bufnr('%') +:e ccc +:let buf_ccc = bufnr('%') +:b1 +:call BufStatus() +:exe buf_bbb . "," . buf_ccc . "bdelete" +:call BufStatus() +:exe buf_aaa . "bdelete" +:call BufStatus() +:e! test.out +:call append('$', g:lines) +:unlet g:lines +:delfunc BufStatus +:w|bd +:b1 +ENDTEST + +STARTTEST +:se hidden :only! :let g:lines = [] :%argd diff --git a/src/nvim/testdir/test_command_count.ok b/src/nvim/testdir/test_command_count.ok index 7219b28e16..8fdbc7748d 100644 --- a/src/nvim/testdir/test_command_count.ok +++ b/src/nvim/testdir/test_command_count.ok @@ -21,15 +21,18 @@ LocalRangeLines 2 5 4argu d 1argu a 100b E16: Invalid range -0close +0close $close 3 $+close E16: Invalid range $tabe 2 $+tabe E16: Invalid range 0tabm x +aaa: 1 bbb: 1 ccc: 1 +aaa: 1 bbb: 0 ccc: 0 +aaa: 0 bbb: 0 ccc: 0 argdo: c d e windo: 2 3 4 -bufdo: 2 3 4 5 6 7 8 9 10 12 +bufdo: 2 3 4 5 6 7 8 9 10 15 bufdo: 3 4 5 6 7 tabdo: 2 3 4 -- cgit From 0c44d0ebfc1ffc6eb07c914acc2e4f432b96ce68 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 31 Jan 2015 20:10:52 -0300 Subject: vim-patch:7.4.588 Problem: ":0argedit foo" puts the new argument in the second place instead of the first. Solution: Adjust the range type. (Ingo Karkat) https://code.google.com/p/vim/source/detail?name=v7-4-588 --- src/nvim/testdir/Makefile | 3 ++- src/nvim/testdir/test_argument_0count.in | 28 ++++++++++++++++++++++++++++ src/nvim/testdir/test_argument_0count.ok | 5 +++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 src/nvim/testdir/test_argument_0count.in create mode 100644 src/nvim/testdir/test_argument_0count.ok (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile index fa68ab8d3a..2dedc3db12 100644 --- a/src/nvim/testdir/Makefile +++ b/src/nvim/testdir/Makefile @@ -32,7 +32,8 @@ SCRIPTS := test_autoformat_join.out \ test_breakindent.out \ test_argument_count.out \ test_close_count.out \ - test_command_count.out + test_command_count.out \ + test_argument_0count.out SCRIPTS_GUI := test16.out diff --git a/src/nvim/testdir/test_argument_0count.in b/src/nvim/testdir/test_argument_0count.in new file mode 100644 index 0000000000..88317fa1fc --- /dev/null +++ b/src/nvim/testdir/test_argument_0count.in @@ -0,0 +1,28 @@ +Tests for :0argadd and :0argedit vim: set ft=vim : + +STARTTEST +:so small.vim +:let arglists = [] +:%argd +:arga a b c d +:2argu +:0arga added +:call add(arglists, argv()) +:2argu +:arga third +:call add(arglists, argv()) +:%argd +:arga a b c d +:2argu +:0arge edited +:call add(arglists, argv()) +:2argu +:arga third +:call add(arglists, argv()) +:e! test.out +:call append(0, map(copy(arglists), 'join(v:val, " ")')) +:w +:qa! +ENDTEST + + diff --git a/src/nvim/testdir/test_argument_0count.ok b/src/nvim/testdir/test_argument_0count.ok new file mode 100644 index 0000000000..ee5daea812 --- /dev/null +++ b/src/nvim/testdir/test_argument_0count.ok @@ -0,0 +1,5 @@ +added a b c d +added a third b c d +edited a b c d +edited a third b c d + -- cgit From b46746b93ef298688cba3d8fbbcdae13e069935c Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Sat, 31 Jan 2015 20:19:53 -0300 Subject: vim-patch:7.4.595 Problem: The test_command_count test fails when using Japanese. Solution: Force the language to C. (Hirohito Higashi) https://code.google.com/p/vim/source/detail?name=v7-4-595 --- src/nvim/testdir/test_command_count.in | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_command_count.in b/src/nvim/testdir/test_command_count.in index 284110a4ec..dd3c108360 100644 --- a/src/nvim/testdir/test_command_count.in +++ b/src/nvim/testdir/test_command_count.in @@ -2,6 +2,7 @@ Test for user command counts vim: set ft=vim : STARTTEST :so tiny.vim +:lang C :let g:lines = [] :com -range=% RangeLines :call add(g:lines, 'RangeLines '..' '.) :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '..' '.) -- cgit