Problem: ":filetype plugin<Tab>" gives "pluginindent" because a
sub option before the cursor is treated as already given.
Solution: only skip plugin and indent when followed by white space.
(glepnir)
closes: #20594
Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
for (;;)
{
- if (STRNCMP(p, "plugin", 6) == 0)
+ if (STRNCMP(p, "plugin", 6) == 0 && VIM_ISWHITE(p[6]))
{
val |= EXPAND_FILETYPECMD_PLUGIN;
p = skipwhite(p + 6);
continue;
}
- if (STRNCMP(p, "indent", 6) == 0)
+ if (STRNCMP(p, "indent", 6) == 0 && VIM_ISWHITE(p[6]))
{
val |= EXPAND_FILETYPECMD_INDENT;
p = skipwhite(p + 6);
call assert_equal('"filetype off on', @:)
call feedkeys(":filetype indent of\<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"filetype indent off', @:)
+ call feedkeys(":filetype plugin\<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"filetype plugin', @:)
+ call feedkeys(":filetype plugin indent\<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"filetype plugin indent', @:)
set wildoptions&
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 683,
/**/
682,
/**/