neovim/runtime/lua
Evgeni Chasnovski dc04ef2a20
perf(filetype): skip contents check in match() if there is no contents (#29596)
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()`).
2024-07-08 11:20:32 -05:00
..
vim perf(filetype): skip contents check in match() if there is no contents (#29596) 2024-07-08 11:20:32 -05:00
_vim9script.lua refactor(lua): rename tbl_islist => islist 2024-04-21 17:08:07 +02:00
coxpcall.lua build(lua): vendor coxpcall 2023-09-10 11:43:37 +02:00
editorconfig.lua feat(editorconfig): add support for spelling_language (#28638) 2024-06-06 09:16:43 -05:00
man.lua fix(man): filter OSC 8 hyperlink markup #29171 2024-06-07 12:43:17 -07:00
tohtml.lua refactor: use vim._with where possible 2024-06-28 19:58:31 +02:00