Skip to content

Instantly share code, notes, and snippets.

@h-east
Last active December 26, 2018 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h-east/5f829b2cd118b7de5c57e7776744b7be to your computer and use it in GitHub Desktop.
Save h-east/5f829b2cd118b7de5c57e7776744b7be to your computer and use it in GitHub Desktop.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 67f505d96..5e67c8632 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2827,18 +2827,22 @@ parse_command_modifiers(exarg_T *eap, char_u **errormsg, int skip_only)
case 't': if (checkforcmd(&p, "tab", 3))
{
- long tabnr = get_address(eap, &eap->cmd, ADDR_TABS,
- eap->skip, skip_only, FALSE, 1);
- if (tabnr == MAXLNUM)
- cmdmod.tab = tabpage_index(curtab) + 1;
- else
+ if (!skip_only)
{
- if (tabnr < 0 || tabnr > LAST_TAB_NR)
+ long tabnr = get_address(eap, &eap->cmd,
+ ADDR_TABS, eap->skip, skip_only, FALSE,
+ 1);
+ if (tabnr == MAXLNUM)
+ cmdmod.tab = tabpage_index(curtab) + 1;
+ else
{
- *errormsg = (char_u *)_(e_invrange);
- return FAIL;
+ if (tabnr < 0 || tabnr > LAST_TAB_NR)
+ {
+ *errormsg = (char_u *)_(e_invrange);
+ return FAIL;
+ }
+ cmdmod.tab = tabnr + 1;
}
- cmdmod.tab = tabnr + 1;
}
eap->cmd = p;
continue;
diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim
index 3c83dd197..86df794b5 100644
--- a/src/testdir/test_search.vim
+++ b/src/testdir/test_search.vim
@@ -783,6 +783,20 @@ func Test_search_cmdline_incsearch_highlight_attr()
bwipe!
endfunc
+func Test_incsearch_cmdline_modifier()
+ if !exists('+incsearch')
+ return
+ endif
+ call test_override("char_avail", 1)
+ new
+ call setline(1, ['foo'])
+ set incsearch
+ " Test that error E14 does not occur in parsing command modifier.
+ call feedkeys("V:tab", 'tx')
+
+ call Incsearch_cleanup()
+endfunc
+
func Test_incsearch_scrolling()
if !CanRunVimInTerminal()
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment