fix(project): properly close window after changing directory (#3919)

## What is this PR for?

In project extra, when using `<c-w>` in the project selection menu to
change directory, the window used to show the command's exit code would
not close. This fixes it.

## Does this PR fix an existing issue?

N/A.

## Checklist

- [x] I've read the
[CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md)
guidelines.
This commit is contained in:
dotfrag 2024-07-05 10:15:57 +03:00 committed by GitHub
parent fb59a9feb0
commit 51e99dfba1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,7 @@ pick = function()
local path = selected[1] local path = selected[1]
local ok = project.set_pwd(path) local ok = project.set_pwd(path)
if ok then if ok then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "n", true) vim.api.nvim_win_close(0, false)
LazyVim.info("Change project dir to " .. path) LazyVim.info("Change project dir to " .. path)
end end
end, end,