Closed KJone1 closed 9 months ago
Can I have some additional context on the problem? what command/function are you calling that is returning the wrong cwd?
Spaceport automatically sets neovim's cwd when navigating to a directory but not a file, so that might be the problem
I start nvim from my home dir /home/kj and spaceport opens:
when selecting '1p' telescope-file-browser opens:
after opening a file and running :pwd the output is:
am i missing something?
Ok so I think I know what is going wrong here:
When spaceport opens a file, the cwd is not set because it is really hard to correctly determine what the cwd should be when looking at a file path
When spaceport encounters an error with reading the json data file, it sets isDir to false for everything (this is what I believe the problem is)
I just wrote a fix for this, but before I publish it, I would like to confirm that that is what is happening with your setup. So could you open the file ~/.local/share/nvim/spaceport.json, format it so that it looks nice, and then confirm that the element with the key of "/home/kj/DEV/dotfiles" has the property isDir set to false?
For example, this is what my ~/.config/nvim folder looks like in the entry:
it seems that everything is set to false
including my pins:
"/home/kj/DEV/sddm-dark-chocolate/": {
"isDir": false,
"pinNumber": 2,
"time": 1706986007
},
"/home/kj/DEV/Ansible_config/": {
"isDir": false,
"pinNumber": 3,
"time": 1707561463
},
"/home/kj/DEV/dotfiles/": {
"isDir": false,
"pinNumber": 1,
"time": 1708711627
},
Ok i just published the change, it should set isDir to the proper value when you open up neovim now. If it still does not work, let me know, otherwise you can just close the issue
I recreated the config file and it works now, thanks :) closing.
For context, when I enter nvim from my home directory and select a saved project, the cwd stays in the home directory. I am not sure if there is an option to change the cwd when selecting a project but the default is false. If not, could it be added as a feature? I could not find any reference to this in the docs. Much appreciated great plugin :D