1
0
Fork 0

nvim: fix weird chdir bug

This commit is contained in:
tastytea 2023-08-07 01:22:43 +02:00
parent d60920c6ac
commit 7de139a6e8
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
1 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,11 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = { 'git', 'Neogit*' },
callback = function()
vim.o.list = false
vim.cmd.lcd(require('my.functions').get_project_root())
-- when root is nil it can mess up pwd for some reason
local root = require('my.functions').get_project_root()
if root then
vim.cmd.lcd(root)
end
end
})