To: vim_dev@googlegroups.com Subject: Patch 9.0.0786 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0786 Problem: User command does not get number from :tab modifier. Solution: Include the number. (closes #11393, closes #6801) Files: src/usercmd.c, src/testdir/test_usercommands.vim *** ../vim-9.0.0785/src/usercmd.c 2022-09-01 12:58:46.584970141 +0100 --- src/usercmd.c 2022-10-18 13:10:24.102980437 +0100 *************** *** 1436,1442 **** // :tab if (cmod->cmod_tab > 0) ! result += add_cmd_modifier(buf, "tab", multi_mods); // :topleft if (cmod->cmod_split & WSP_TOP) result += add_cmd_modifier(buf, "topleft", multi_mods); --- 1436,1459 ---- // :tab if (cmod->cmod_tab > 0) ! { ! int tabnr = cmod->cmod_tab - 1; ! ! if (tabnr == tabpage_index(curtab)) ! { ! // For compatibility, don't add a tabpage number if it is the same ! // as the default number for :tab. ! result += add_cmd_modifier(buf, "tab", multi_mods); ! } ! else ! { ! char tab_buf[NUMBUFLEN + 3]; ! ! sprintf(tab_buf, "%dtab", tabnr); ! result += add_cmd_modifier(buf, tab_buf, multi_mods); ! } ! } ! // :topleft if (cmod->cmod_split & WSP_TOP) result += add_cmd_modifier(buf, "topleft", multi_mods); *** ../vim-9.0.0785/src/testdir/test_usercommands.vim 2022-10-15 21:35:51.191403811 +0100 --- src/testdir/test_usercommands.vim 2022-10-18 13:07:47.423225600 +0100 *************** *** 81,86 **** --- 81,99 ---- call assert_equal('silent!', g:mods) tab MyCmd call assert_equal('tab', g:mods) + 0tab MyCmd + call assert_equal('0tab', g:mods) + tab split + tab MyCmd + call assert_equal('tab', g:mods) + 1tab MyCmd + call assert_equal('1tab', g:mods) + tabprev + tab MyCmd + call assert_equal('tab', g:mods) + 2tab MyCmd + call assert_equal('2tab', g:mods) + 2tabclose topleft MyCmd call assert_equal('topleft', g:mods) to MyCmd *** ../vim-9.0.0785/src/version.c 2022-10-17 20:00:20.952748360 +0100 --- src/version.c 2022-10-18 13:09:14.967087970 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 786, /**/ -- "I know that there are people who don't love their fellow man, and I hate those people!" - Tom Lehrer /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///