neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit f2fa11708ce6e9d28d1d304dfb05a6476b950042
parent 0c363d1a709f4ae07d263a38908cba723dbe7d5e
Author: Christian Clason <c.clason@uni-graz.at>
Date:   Mon, 27 Jun 2022 20:43:37 +0200

fix(filetype): check for non-nil match in detect.rules (#19129)


Diffstat:
Mruntime/lua/vim/filetype/detect.lua | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/runtime/lua/vim/filetype/detect.lua b/runtime/lua/vim/filetype/detect.lua @@ -906,9 +906,11 @@ function M.rules(path) local dir = vim.fn.expand(path, ':h') for _, line in ipairs(config_lines) do local match = line:match(udev_rules_pattern) - local udev_rules = line:gsub(udev_rules_pattern, match, 1) - if dir == udev_rules then - return 'udevrules' + if match then + local udev_rules = line:gsub(udev_rules_pattern, match, 1) + if dir == udev_rules then + return 'udevrules' + end end end return 'hog'