diff options
author | max397574 <[email protected]> | 2021-10-24 13:59:51 +0200 |
---|---|---|
committer | max397574 <[email protected]> | 2021-10-24 13:59:51 +0200 |
commit | e216cf6121aab25e7a19ccbd04cc56dfecacfacf (patch) | |
tree | 08c7031629d2e65506ffd4066665822f74ac04cf /lua | |
parent | 41b767ecf8f533baf277857503e2fd8bdccc757f (diff) |
feat(utils): ✨use function to get directory which works everywhere
Diffstat (limited to 'lua')
-rw-r--r-- | lua/startup/utils.lua | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lua/startup/utils.lua b/lua/startup/utils.lua index 3a9dba3..aa343b8 100644 --- a/lua/startup/utils.lua +++ b/lua/startup/utils.lua @@ -56,9 +56,7 @@ end function U.get_oldfiles_directory(amount) local oldfiles_raw = vim.fn.execute "oldfiles" local oldfiles_amount = 0 - -- local directory = vim.api.nvim_exec([[!pwd]], true) - local directory = os.getenv "PWD" - directory = string.sub(directory, 1, -2) + local directory = vim.api.nvim_exec([[pwd]], true) local oldfiles = { "Last files in " .. directory, " " } for file in oldfiles_raw:gmatch(directory .. "[^\n]+") do if oldfiles_amount >= amount then |