diff options
author | Felipe Morales <hel.sheep@gmail.com> | 2015-01-15 18:33:02 -0300 |
---|---|---|
committer | Felipe Morales <hel.sheep@gmail.com> | 2015-04-28 23:08:31 -0300 |
commit | d2ad709a1e8eb9674e2744015cb609e941ea78f1 (patch) | |
tree | 7114631404d22968ee733ec1daf7fae864c51e32 /src | |
parent | 87953bf5ff44006567c7b8a210406d79ae9e4fad (diff) | |
download | rneovim-d2ad709a1e8eb9674e2744015cb609e941ea78f1.tar.gz rneovim-d2ad709a1e8eb9674e2744015cb609e941ea78f1.tar.bz2 rneovim-d2ad709a1e8eb9674e2744015cb609e941ea78f1.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_docmd.c | 6 | ||||
-rw-r--r-- | src/nvim/testdir/test_command_count.in | 8 | ||||
-rw-r--r-- | src/nvim/testdir/test_command_count.ok | 2 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 75d324b421..6beb8b3523 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1420,10 +1420,12 @@ static char_u * do_one_cmd(char_u **cmdlinep, * is equal to the lower. */ - if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_SIZE) { + if (ea.cmdidx != CMD_SIZE + && ea.cmdidx != CMD_USER + && ea.cmdidx != CMD_USER_BUF) { ea.addr_type = cmdnames[(int)ea.cmdidx].cmd_addr_type; } else { - if (ea.cmdidx != CMD_USER) { + if (ea.cmdidx != CMD_USER && ea.cmdidx != CMD_USER_BUF) { ea.addr_type = ADDR_LINES; // ea.addr_type for user commands is set by find_ucmd } 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 '.<line1>.' '.<line2>) +:com -range=% RangeLines :call add(g:lines, 'RangeLines '.<line1>.' '.<line2>) :com -range -addr=arguments RangeArguments :call add(g:lines, 'RangeArguments '.<line1>.' '.<line2>) :com -range=% -addr=arguments RangeArgumentsAll :call add(g:lines, 'RangeArgumentsAll '.<line1>.' '.<line2>) :com -range -addr=loaded_buffers RangeLoadedBuffers :call add(g:lines, 'RangeLoadedBuffers '.<line1>.' '.<line2>) @@ -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 '.<line1>.' '.<line2>) +:'<,'>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 diff --git a/src/nvim/version.c b/src/nvim/version.c index 3cf38f691f..86722a992f 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -218,7 +218,7 @@ static int included_patches[] = { //564, 563, //562, - //561, + 561, //560 NA 559, //558 NA |