Mercurial > vim
changeset 15573:060cb54565c1 v8.1.0794
patch 8.1.0794: white space before " -Ntabmove" causes problems
commit https://github.com/vim/vim/commit/82a12468bd023f5cdc5d27182bedef7881514643
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 22 22:41:42 2019 +0100
patch 8.1.0794: white space before " -Ntabmove" causes problems
Problem: White space before " -Ntabmove" causes problems.
Solution: Skip whitespace. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/3841)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 22 Jan 2019 22:45:06 +0100 |
parents | b28776ed9fb2 |
children | a34813688b82 |
files | src/ex_docmd.c src/testdir/test_tabpage.vim src/version.c |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7588,7 +7588,7 @@ get_tabpage_arg(exarg_T *eap) else { tab_number = eap->line2; - if (!unaccept_arg0 && **eap->cmdlinep == '-') + if (!unaccept_arg0 && *skipwhite(*eap->cmdlinep) == '-') { --tab_number; if (tab_number < unaccept_arg0)
--- a/src/testdir/test_tabpage.vim +++ b/src/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