Open asmodeus812 opened 1 year ago
Hi, any idea on that one ?
I have no idea. As far as I know, nvim-cmp does not set cwd.
Indeed, i did grep the source for 'cd' like commands, nothing popped up very strange, i have no idea what might be causing that, it could a bug upstream, that somehow interacts with some functionality of nvim cmp or cmdline but thats the best i got.
I suspect nvim_parse_cmd or vim.fn.getcompletion is the culprit.
@hrsh7th not sure if this needs to get prio, but can easily cause havoc on new users, the bug is so obscure, yet it breaks a very important feature, the cwd context.
Hm.... It seems not getcompletion()
problem.
Because ddc.vim command line completion works as expected.
FAQ
Announcement
Minimal reproducible full config
Description
Strange issue / interaction with scoped working directories when using cmp with cmp.cmdline.
Steps to reproduce
open nvim with provided config above. :e
:tcd /home/user/.local
:vsp
:verbose pwd ([tabpage] /home/user/.local) - correct, the tab working directory is as it is
:enew | lcd /home/user/.config
:verbose pwd ([window] /home/user/.local) - whereas it should be /home/user/.config, also note verbose prints [window] in front of it which is correct.
NOTE: getcwd() also prints the wrong tab directory (tcd) instead of the local directory (lcd)
Expected behavior
The lcd should be returned as expected.
Actual behavior
The working directory returned is incorrect.
Additional context
No response