From d7b942b54e4bae5510549ceffb3280e89871cff5 Mon Sep 17 00:00:00 2001 From: Grzegorz Milka Date: Sun, 23 Oct 2016 00:00:47 +0200 Subject: vim-patch:7.4.2237 Problem: Can't use "." and "$" with ":tab". Solution: Support a range for ":tab". (Hirohito Higashi) https://github.com/vim/vim/commit/9b7f8ce9eb3cb704f8cc14ab659bf86b1d6dc13c --- src/nvim/ex_docmd.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 9f83688e1e..cbe4d19d2c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1302,8 +1302,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, * 2. Handle command modifiers. */ p = ea.cmd; - if (ascii_isdigit(*ea.cmd)) - p = skipwhite(skipdigits(ea.cmd)); + p = skip_range(ea.cmd, NULL); switch (*p) { /* When adding an entry, also modify cmd_exists(). */ case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3)) @@ -1406,12 +1405,18 @@ static char_u * do_one_cmd(char_u **cmdlinep, continue; case 't': if (checkforcmd(&p, "tab", 3)) { - if (ascii_isdigit(*ea.cmd)) - cmdmod.tab = atoi((char *)ea.cmd) + 1; - else - cmdmod.tab = tabpage_index(curtab) + 1; - ea.cmd = p; - continue; + long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS, ea.skip, false); + if (tabnr == MAXLNUM) { + cmdmod.tab = tabpage_index(curtab) + 1; + } else { + if (tabnr < 0 || tabnr > LAST_TAB_NR) { + errormsg = (char_u *)_(e_invrange); + goto doend; + } + cmdmod.tab = tabnr + 1; + } + ea.cmd = p; + continue; } if (!checkforcmd(&ea.cmd, "topleft", 2)) break; -- cgit From 9755a2ffd5727c7fc0576e60a21368618978c504 Mon Sep 17 00:00:00 2001 From: Grzegorz Milka Date: Tue, 18 Oct 2016 02:02:47 +0200 Subject: vim-patch:7.4.2312 Problem: Crash when autocommand moves to another tab. (Dominique Pelle) Solution: When navigating to another window halfway the :edit command go back to the right window. https://github.com/vim/vim/commit/5a49789a9b1f6447aeafbbbdd5b235dd10c471d5 --- src/nvim/ex_docmd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index cbe4d19d2c..5c84b5bb4e 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1772,10 +1772,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, if (text_locked() && !(ea.argt & CMDWIN) && !IS_USER_CMDIDX(ea.cmdidx)) { /* Command not allowed when editing the command line. */ - if (cmdwin_type != 0) - errormsg = (char_u *)_(e_cmdwin); - else - errormsg = (char_u *)_(e_secure); + errormsg = get_text_locked_msg(); goto doend; } /* Disallow editing another buffer when "curbuf_lock" is set. -- cgit From d357a42389752b5270cf590b2f078f836de6c736 Mon Sep 17 00:00:00 2001 From: Grzegorz Milka Date: Sun, 23 Oct 2016 00:56:15 +0200 Subject: Fix lint errors. --- src/nvim/ex_docmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 5c84b5bb4e..5e418bf099 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1771,7 +1771,7 @@ static char_u * do_one_cmd(char_u **cmdlinep, if (text_locked() && !(ea.argt & CMDWIN) && !IS_USER_CMDIDX(ea.cmdidx)) { - /* Command not allowed when editing the command line. */ + // Command not allowed when editing the command line. errormsg = get_text_locked_msg(); goto doend; } -- cgit