summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-30 19:39:29 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-30 19:39:29 +0200
commit3bcfca3ab4db415d0e750e00204dd25a91fcee77 (patch)
tree648834bb80120baa518101b1612d6e24a6fb62f4
parent90d121fa3637b423169c64528efe84a1e67060c9 (diff)
patch 7.4.2127v7.4.2127
Problem: The short form of ":noswapfile" is ":noswap" instead of ":now". (Kent Sibilev) Solution: Only require three characters. Add a test for the short forms.
-rw-r--r--src/ex_docmd.c2
-rw-r--r--src/testdir/test_usercommands.vim34
-rw-r--r--src/version.c2
3 files changed, 33 insertions, 5 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 34c9955c16..1a7fbfabb7 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1954,7 +1954,7 @@ do_one_cmd(
#endif
continue;
}
- if (!checkforcmd(&ea.cmd, "noswapfile", 6))
+ if (!checkforcmd(&ea.cmd, "noswapfile", 3))
break;
cmdmod.noswapfile = TRUE;
continue;
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim
index e6c31962dd..1f92adab73 100644
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -8,31 +8,57 @@ function Test_cmdmods()
MyCmd
aboveleft MyCmd
+ abo MyCmd
belowright MyCmd
+ bel MyCmd
botright MyCmd
+ bo MyCmd
browse MyCmd
+ bro MyCmd
confirm MyCmd
+ conf MyCmd
hide MyCmd
+ hid MyCmd
keepalt MyCmd
+ keepa MyCmd
keepjumps MyCmd
+ keepj MyCmd
keepmarks MyCmd
+ kee MyCmd
keeppatterns MyCmd
+ keepp MyCmd
+ leftabove MyCmd " results in :aboveleft
+ lefta MyCmd
lockmarks MyCmd
+ loc MyCmd
+ " noautocmd MyCmd
noswapfile MyCmd
+ nos MyCmd
+ rightbelow MyCmd " results in :belowright
+ rightb MyCmd
+ " sandbox MyCmd
silent MyCmd
+ sil MyCmd
tab MyCmd
topleft MyCmd
+ to MyCmd
+ " unsilent MyCmd
verbose MyCmd
+ verb MyCmd
vertical MyCmd
+ vert MyCmd
aboveleft belowright botright browse confirm hide keepalt keepjumps
\ keepmarks keeppatterns lockmarks noswapfile silent tab
\ topleft verbose vertical MyCmd
- call assert_equal(' aboveleft belowright botright browse confirm ' .
- \ 'hide keepalt keepjumps keepmarks keeppatterns lockmarks ' .
- \ 'noswapfile silent tab topleft verbose vertical aboveleft ' .
- \ 'belowright botright browse confirm hide keepalt keepjumps ' .
+ call assert_equal(' aboveleft aboveleft belowright belowright botright ' .
+ \ 'botright browse browse confirm confirm hide hide ' .
+ \ 'keepalt keepalt keepjumps keepjumps keepmarks keepmarks ' .
+ \ 'keeppatterns keeppatterns aboveleft aboveleft lockmarks lockmarks noswapfile ' .
+ \ 'noswapfile belowright belowright silent silent tab topleft topleft verbose verbose ' .
+ \ 'vertical vertical ' .
+ \ 'aboveleft belowright botright browse confirm hide keepalt keepjumps ' .
\ 'keepmarks keeppatterns lockmarks noswapfile silent tab topleft ' .
\ 'verbose vertical ', g:mods)
diff --git a/src/version.c b/src/version.c
index f456729f52..513712198a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2127,
+/**/
2126,
/**/
2125,