Closed tobias-haenel closed 9 months ago
Removing a workspace by executing :WorkspacesRemove WS_NAME, sometimes removes the workspace with the path to the current working directory.
:WorkspacesRemove WS_NAME
The bug seems to be at line 293 in remove_workspace_or_directory https://github.com/natecraddock/workspaces.nvim/blob/a6fb4995333f927cc6f707890800fa7f7c476043/lua/workspaces/init.lua#L291-L314
remove_workspace_or_directory
path
name
nil
find
Proposed fix: Change line 293 to
local path = (not name and cwd()) or nil
Nice catch! Thanks for looking into this, and for providing a fix. I tested it locally and it works great. I just pushed a commit to resolve this!
Removing a workspace by executing
:WorkspacesRemove WS_NAME
, sometimes removes the workspace with the path to the current working directory.The bug seems to be at line 293 in
remove_workspace_or_directory
https://github.com/natecraddock/workspaces.nvim/blob/a6fb4995333f927cc6f707890800fa7f7c476043/lua/workspaces/init.lua#L291-L314path
is set to current working directory even ifname
is notnil
find
returns a workspace whose path matches the current working directoryProposed fix: Change line 293 to