diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-02 22:37:24 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-02 22:40:10 -0400 |
commit | 31755783e330d5b3761fc471ae512d61638cae9d (patch) | |
tree | 17c81134a368db8548fd09c34b384e8973824c27 | |
parent | 9d58a58980c666a3abf515a1dd6b813b13d2d5ae (diff) | |
download | rneovim-31755783e330d5b3761fc471ae512d61638cae9d.tar.gz rneovim-31755783e330d5b3761fc471ae512d61638cae9d.tar.bz2 rneovim-31755783e330d5b3761fc471ae512d61638cae9d.zip |
vim-patch:8.1.0794: white space before " -Ntabmove" causes problems
Problem: White space before " -Ntabmove" causes problems.
Solution: Skip whitespace. (Ozaki Kiichi, closes vim/vim#3841)
https://github.com/vim/vim/commit/82a12468bd023f5cdc5d27182bedef7881514643
-rw-r--r-- | src/nvim/ex_docmd.c | 2 | ||||
-rw-r--r-- | src/nvim/testdir/test_tabpage.vim | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index a028814f3d..ace5b5c093 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -4505,7 +4505,7 @@ static int get_tabpage_arg(exarg_T *eap) tab_number = 0; } else { tab_number = eap->line2; - if (!unaccept_arg0 && **eap->cmdlinep == '-') { + if (!unaccept_arg0 && *skipwhite(*eap->cmdlinep) == '-') { --tab_number; if (tab_number < unaccept_arg0) { eap->errmsg = e_invarg; diff --git a/src/nvim/testdir/test_tabpage.vim b/src/nvim/testdir/test_tabpage.vim index add9b3d7cf..48ac6eb2f2 100644 --- a/src/nvim/testdir/test_tabpage.vim +++ b/src/nvim/testdir/test_tabpage.vim @@ -105,6 +105,14 @@ function Test_tabpage() call assert_equal(4, tabpagenr()) 7tabmove 5 call assert_equal(5, tabpagenr()) + -tabmove + call assert_equal(4, tabpagenr()) + +tabmove + call assert_equal(5, tabpagenr()) + -2tabmove + call assert_equal(3, tabpagenr()) + +3tabmove + call assert_equal(6, tabpagenr()) " The following are a no-op norm! 2gt |