mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(filetype): fix :filetype detect error with -u NONE (#29991)
:filetype detect should enable filetype detection when it hasn't been enabled before.
This commit is contained in:
parent
37952bf7b4
commit
93347a67bf
@ -7330,7 +7330,7 @@ static void ex_filetype(exarg_T *eap)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (strcmp(arg, "on") == 0 || strcmp(arg, "detect") == 0) {
|
if (strcmp(arg, "on") == 0 || strcmp(arg, "detect") == 0) {
|
||||||
if (*arg == 'o' || !filetype_detect) {
|
if (*arg == 'o' || filetype_detect != kTrue) {
|
||||||
source_runtime(FILETYPE_FILE, DIP_ALL);
|
source_runtime(FILETYPE_FILE, DIP_ALL);
|
||||||
filetype_detect = kTrue;
|
filetype_detect = kTrue;
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
|
@ -112,6 +112,13 @@ describe('startup', function()
|
|||||||
|*2
|
|*2
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it(':filetype detect enables filetype detection with -u NONE', function()
|
||||||
|
clear()
|
||||||
|
eq('filetype detection:OFF plugin:OFF indent:OFF', exec_capture('filetype'))
|
||||||
|
command('filetype detect')
|
||||||
|
eq('filetype detection:ON plugin:OFF indent:OFF', exec_capture('filetype'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('startup', function()
|
describe('startup', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user