aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-01-14 14:20:17 -0700
committerGitHub <noreply@github.com>2022-01-14 14:20:17 -0700
commit59ea8fa322c946183631233ae546e3e8b0c37e30 (patch)
treeaa4b402e25f146b3699b2da30fea3db7f7d11212 /runtime/lua/vim
parentbac4bb1900059b3f6dfbaabe641571a60b1cb951 (diff)
downloadrneovim-59ea8fa322c946183631233ae546e3e8b0c37e30.tar.gz
rneovim-59ea8fa322c946183631233ae546e3e8b0c37e30.tar.bz2
rneovim-59ea8fa322c946183631233ae546e3e8b0c37e30.zip
fix(filetype): expand tildes in filetype patterns (#17091)
This allows patterns like ["~/.config/foo"] = "fooscript" to work.
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/filetype.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 13da5286c8..819587bb3e 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -1398,7 +1398,7 @@ local pattern_sorted = sort_by_priority(pattern)
---@private
local function normalize_path(path)
- return (path:gsub("\\", "/"))
+ return (path:gsub("\\", "/"):gsub("^~", vim.env.HOME))
end
--- Add new filetype mappings.