natecraddock / workspaces.nvim

a simple plugin to manage workspace directories in neovim
MIT License
309 stars 15 forks source link

Workspaces in `workspaces` file are not found #20

Closed maxmahlke closed 1 year ago

maxmahlke commented 1 year ago

Hi,

I recently had an issue opening workspaces using WorkspacesOpen: nothing happened when selecting them from the telescope interface. Using :messages, I saw that the workspace "does not exist" according to the plugin.

I checked the .local/share/nvim/workspaces file and found the workspace. The directory exists as well. I dug into the plugin code and found that the workspace is given as non-existent as the type attribute check added in #18 fails.

https://github.com/natecraddock/workspaces.nvim/blob/f74c1e82e343a6f90edbf6adb701054c801e9de2/lua/workspaces/init.lua#L208

It fails because my workspaces file has no type column yet and the workspace.type attribute is nil. The solution was to delete my workspaces file and start a new one. Not pleasant, but not the end of the world either.

Leaving this here for anyone who might run into the same issue.

natecraddock commented 1 year ago

Hey! I'm so sorry about this bug, I totally thought I had checked this case but it looks like I didn't :(

Thank you for reporting, I'm actually surprised no one else has reported this by now. I just pushed a fix for the bug. Though in your case it won't make a difference because you already created a new workspace file.

maxmahlke commented 1 year ago

No worries at all! And thanks for keeping the plugin going even though you moved on from neovim! It's super handy.