mirror of
https://github.com/neovim/neovim.git
synced 2026-04-01 13:22:08 +00:00
perf(filetype): vim.filetype.get_option cache miss when option value is false #37593
Problem: when option value is false, it's treated as invalid then trigger FileType event again Solution: use cached false value
This commit is contained in:
@@ -77,7 +77,7 @@ end
|
|||||||
function M.get_option(filetype, option)
|
function M.get_option(filetype, option)
|
||||||
update_ft_option_cache(filetype)
|
update_ft_option_cache(filetype)
|
||||||
|
|
||||||
if not ft_option_cache[filetype] or not ft_option_cache[filetype][option] then
|
if not ft_option_cache[filetype] or ft_option_cache[filetype][option] == nil then
|
||||||
ft_option_cache[filetype] = ft_option_cache[filetype] or {}
|
ft_option_cache[filetype] = ft_option_cache[filetype] or {}
|
||||||
ft_option_cache[filetype][option] = api.nvim_get_option_value(option, { filetype = filetype })
|
ft_option_cache[filetype][option] = api.nvim_get_option_value(option, { filetype = filetype })
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user