linux-cultist / venv-selector.nvim

Allows selection of python virtual environment from within neovim
MIT License
388 stars 41 forks source link

Lazy eval cwd in venv.lua #17

Closed GordianDziwis closed 1 year ago

GordianDziwis commented 1 year ago

https://github.com/linux-cultist/venv-selector.nvim/blob/653b2b37ba5c7637dbc29d2d4f5f236d7e8f93e4/lua/venv-selector/venv.lua#L14

M.cwd is always set to the home directory in my setup. Change M.cwd to:

    local venv_cache = {
        [vim.fn.getcwd()] = { value = venv.value },
    }
linux-cultist commented 1 year ago

Just to understand what you would like, do you want your current working directory to be the same as the virtual environment directory?

linux-cultist commented 1 year ago

I understand now after looking at the code. This was added in a PR by another developer and I think the intention was to use the current cwd every time the VenvSelectCached is executed.

Will change it so it always looks at the current cwd. Thank you!