mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.1.0231: Filetype may be undetected when SwapExists sets ft in other buf (#28136)
Problem: Filetype may be undetected when a SwapExists autocommand sets
filetype in another buffer.
Solution: Make filetype detection state buffer-specific. Also fix a
similar problem for 'modified' (zeertzjq).
closes: vim/vim#14344
5bf6c2117f
This commit is contained in:
@@ -7382,7 +7382,7 @@ void filetype_maybe_enable(void)
|
||||
/// ":setfiletype [FALLBACK] {name}"
|
||||
static void ex_setfiletype(exarg_T *eap)
|
||||
{
|
||||
if (did_filetype) {
|
||||
if (curbuf->b_did_filetype) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7393,7 +7393,7 @@ static void ex_setfiletype(exarg_T *eap)
|
||||
|
||||
set_option_value_give_err(kOptFiletype, CSTR_AS_OPTVAL(arg), OPT_LOCAL);
|
||||
if (arg != eap->arg) {
|
||||
did_filetype = false;
|
||||
curbuf->b_did_filetype = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user