mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
dc04ef2a20
Problem: `vim.filetype.match()` tries to match on contents even if there is no contents (empty buffer or `{''}` explicit contents). This results in extra avoidable execution duration for cases. It matters, for example, when trying to match filetype based solely on file name (which still needs `contents` or `buf` to properly match earlier in the code path). Solution: skip matching based solely on contents if it is `{''}`. This works because: - Matching solely on content is done after any user-configured `vim.filetype.add()` hooks. - All default matching on content might depend on supplied path *only* if there is non-empty content (like in `require('vim.filetype.detect').match_from_hashbang()`). |
||
---|---|---|
.. | ||
vim | ||
_vim9script.lua | ||
coxpcall.lua | ||
editorconfig.lua | ||
man.lua | ||
tohtml.lua |