Skip to content

Commit f77b655

Browse files
committed
fix: use realpath of vim related path
1 parent 3ecf0d1 commit f77b655

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/core/global.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
local global = {}
22
local os_name = vim.uv.os_uname().sysname
3+
local realpath = vim.uv.fs_realpath
34

45
function global:load_variables()
56
self.is_mac = os_name == "Darwin"
67
self.is_linux = os_name == "Linux"
78
self.is_windows = os_name == "Windows_NT"
89
self.is_wsl = vim.fn.has("wsl") == 1
9-
self.vim_path = vim.fn.stdpath("config")
10-
self.cache_dir = vim.fn.stdpath("cache")
11-
self.data_dir = string.format("%s/site/", vim.fn.stdpath("data"))
10+
self.vim_path = realpath(vim.fn.stdpath("config"))
11+
self.cache_dir = realpath(vim.fn.stdpath("cache"))
12+
self.data_dir = string.format("%s/site/", realpath(vim.fn.stdpath("data")))
1213
self.modules_dir = self.vim_path .. "/modules"
1314
self.home = self.is_windows and vim.env.USERPROFILE or vim.env.HOME
1415
end

0 commit comments

Comments
 (0)