remote-sshfs.nvim icon indicating copy to clipboard operation
remote-sshfs.nvim copied to clipboard

Dirrefresh (#1)

Open davidoroian opened this issue 4 months ago • 3 comments

Added vim.cmd('edit .') to refresh the nvim UI current directory after the pwd is changed to the remote filessytem.

Not sure if this is the best way of doing it. I had the issue of the UI not being updated on two separate machines running Fedora42 and Ubuntu22.04

davidoroian avatar Sep 28 '25 13:09 davidoroian

Sorry for making multiple PRs and closing them, but this is the first time I have created a PR for an open-source project.

davidoroian avatar Sep 28 '25 13:09 davidoroian

When I use api.disconnect I get:

E5108: Error executing lua: .../lazy/remote-sshfs.nvim/lua/remote-sshfs/connections.lua:303: attempt to index a boolean value                                                              
stack traceback:                                                                                                                                                                           
        .../lazy/remote-sshfs.nvim/lua/remote-sshfs/connections.lua:303: in function 'unmount_host'                                                                                        
        ...are/nvim/lazy/remote-sshfs.nvim/lua/remote-sshfs/api.lua:12: in function <...are/nvim/lazy/remote-sshfs.nvim/lua/remote-sshfs/api.lua:11>

I will write the fix for this in this PR as well

The error was caused because pcall returns two values: a boolean (true, false) and what would be the module. But, in the telescope extension register_extension returns a boolean as well. That is why there is the attempt to index a boolean.

davidoroian avatar Sep 29 '25 05:09 davidoroian

I will keep working on this but I have been a bit busy with university lately. One problem that I am facing and maybe there is a better way of doing it is, I find it quite obscure to find out how to refresh the UI for nvim. For example finding an alternative for "edit .". Do you have any recommandations for where to look? I have been so far looking into the Nvim docs, but did not really find anything, it might also be that I have not looked enough or I missed it. Tired LLMs as well, but did not find anything useful.

davidoroian avatar Nov 01 '25 14:11 davidoroian