diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2022-01-04 15:02:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 15:02:01 -0700 |
commit | 60d3bb745d72cbf7dd3d83660e6f4d8c1a9dd770 (patch) | |
tree | 9f85142e461b996950c0d1fab7c0a1e52f05c5fe | |
parent | 8ade8009ee1fb508bf94ca6c8c3cd288f051c55b (diff) | |
download | rneovim-60d3bb745d72cbf7dd3d83660e6f4d8c1a9dd770.tar.gz rneovim-60d3bb745d72cbf7dd3d83660e6f4d8c1a9dd770.tar.bz2 rneovim-60d3bb745d72cbf7dd3d83660e6f4d8c1a9dd770.zip |
fix(filetype): set default ft_ignore_pat in filetype.lua (#16917)
This default value is also set in filetype.vim, but if filetype.vim is
disabled the variable is never defined, which causes errors in some of
the dist#ft detection functions.
-rw-r--r-- | .luacheckrc | 4 | ||||
-rw-r--r-- | runtime/filetype.lua | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/.luacheckrc b/.luacheckrc index 487f5ab552..9bbd323e84 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -26,6 +26,10 @@ read_globals = { "vim", } +globals = { + "vim.g", +} + exclude_files = { 'test/functional/fixtures/lua/syntax_error.lua', } diff --git a/runtime/filetype.lua b/runtime/filetype.lua index 3177705b65..855baf7dfa 100644 --- a/runtime/filetype.lua +++ b/runtime/filetype.lua @@ -20,3 +20,7 @@ let g:did_load_ftdetect = 1 augroup END ]] + +if not vim.g.ft_ignore_pat then + vim.g.ft_ignore_pat = "\\.\\(Z\\|gz\\|bz2\\|zip\\|tgz\\)$" +end |