diff options
author | James McCoy <jamessan@jamessan.com> | 2022-05-04 02:13:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 08:13:01 +0200 |
commit | c051ea83dd059920714adb39459b3b703ce6f15a (patch) | |
tree | ed951ab6ae1a89ae28c83a145db75308150339d9 | |
parent | 815b65d77713c69bbcb5c80892f6dd49aac8edd9 (diff) | |
download | rneovim-c051ea83dd059920714adb39459b3b703ce6f15a.tar.gz rneovim-c051ea83dd059920714adb39459b3b703ce6f15a.tar.bz2 rneovim-c051ea83dd059920714adb39459b3b703ce6f15a.zip |
refactor(lua): replace hard-coded gsub with vim.pesc() (#18407)
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index 77ebb64b1d..32f4f825c1 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -1490,7 +1490,7 @@ local function normalize_path(path, as_pattern) if as_pattern then -- Escape Lua's metacharacters when $HOME is used in a pattern. -- The rest of path should already be properly escaped. - normal = vim.env.HOME:gsub('[-^$()%%.%[%]+?]', '%%%0') .. normal:sub(2) + normal = vim.pesc(vim.env.HOME) .. normal:sub(2) else normal = vim.env.HOME .. normal:sub(2) end |