nvim: fix weird chdir bug
This commit is contained in:
parent
d60920c6ac
commit
7de139a6e8
|
@ -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
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user