From 60d3bb745d72cbf7dd3d83660e6f4d8c1a9dd770 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 4 Jan 2022 15:02:01 -0700 Subject: [PATCH] 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. --- .luacheckrc | 4 ++++ runtime/filetype.lua | 4 ++++ 2 files changed, 8 insertions(+) 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