if (idx < 0)
return NULL;
- if (filetype_expand_what == EXP_FILETYPECMD_ALL && idx < 4)
+ if (filetype_expand_what == EXP_FILETYPECMD_ALL && idx < 5)
{
- char *opts_all[] = {"indent", "plugin", "on", "off"};
+ char *opts_all[] = {"detect", "indent", "plugin", "on", "off"};
return (char_u *)opts_all[idx];
}
if (filetype_expand_what == EXP_FILETYPECMD_PLUGIN && idx < 3)
call assert_equal([], l)
let l = getcompletion('', 'filetypecmd')
- call assert_equal(["indent", "off", "on", "plugin"], l)
+ call assert_equal(["detect", "indent", "off", "on", "plugin"], l)
let l = getcompletion('not', 'filetypecmd')
call assert_equal([], l)
let l = getcompletion('o', 'filetypecmd')
call assert_equal(['off', 'on'], l)
+ let l = getcompletion('det', 'filetypecmd')
+ call assert_equal(['detect'], l)
let l = getcompletion('tag', 'function')
call assert_true(index(l, 'taglist(') >= 0)
func Test_completion_filetypecmd()
set wildoptions&
call feedkeys(":filetype \<C-A>\<C-B>\"\<CR>", 'tx')
- call assert_equal('"filetype indent off on plugin', @:)
+ call assert_equal('"filetype detect indent off on plugin', @:)
+ call feedkeys(":filetype det\<C-A>\<C-B>\"\<CR>", 'tx')
+ call assert_equal('"filetype detect', @:)
call feedkeys(":filetype plugin \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_equal('"filetype plugin indent off on', @:)
call feedkeys(":filetype indent \<C-A>\<C-B>\"\<CR>", 'tx')