Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: handle restricted UNC paths on Windows #404

Open
1 task done
matu3ba opened this issue Jun 4, 2024 · 2 comments · May be fixed by #493
Open
1 task done

feature request: handle restricted UNC paths on Windows #404

matu3ba opened this issue Jun 4, 2024 · 2 comments · May be fixed by #493
Labels
enhancement New feature or request P2 Not a priority. PRs welcome

Comments

@matu3ba
Copy link

matu3ba commented Jun 4, 2024

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

I'd like to be able to use oil.nvim with locally mounted UNC paths on Windows for fast looking into files after search via fd and gf to open a file and use map('n', '<leader>ex', [[<cmd>lua require("oil").open()<CR>]], opts) -- open dir of current buffer instead of cwd to traverse the directory.

Provide background

Upon execution of <leader>ex mapped to

I get

E5108: Error executing lua ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: BufReadCmd Autokommandos für "oil://*": Vim(append):Error executing lua callback: ...fer/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/fs.lua:89: attempt to index local 'drive' (a nil value)                                                                                                                                                                                                                                                                  stack traceback:                                                                                                                                                                                                                                                                      ...fer/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/fs.lua:89: in function 'posix_to_os_path'                                                                                                                                                                                ...Local/nvim-data/lazy/oil.nvim/lua/oil/adapters/files.lua:229: in function 'normalize_url'                                                                                                                                                                                  ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:966: in function 'load_oil_buffer'                                                                                                                                                                                ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:1088: in function <...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:1087>                                                                                                                              [C]: in function 'edit'                                                                                                                                                                                                                                                       ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: in function 'open'                                                                                                                                                                                           [string ":lua"]:1: in main chunk                                                                                                                                                                                                                                      stack traceback:                                                                                                                                                                                                                                                                      [C]: in function 'edit'                                                                                                                                                                                                                                                       ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: in function 'open'                                                                                                                                                                                           [string ":lua"]:1: in main chunk

and a never finishing loading dialog

      Loading
                                                         [     ====         ]

What is the significance of this feature?

nice to have

Additional details

Why?
If one does frequent remote operations on Windows (in local ir VPN network), one will not want to mount remote pcs to hard drives like R:\ to prevent clashes of different machines or accidental copying/overwriting wrong machines.

The alternative is 1. to not use oil.nvim or 2. use yazi for inspection or 3. use :e \\ip\drive\pathtofile, 4. traverse via shell to the other files.

UNC paths with restrictions are quite feasible to implement, see https://github.com/ziglang/zig/blob/332fbb4b027a5529e58b1e46d785718a7faa75e6/lib/std/fs/path.zig#L1403.

If not, then please briefly explain scope of filepath shennanigans/complexity you're willing to handle in this plugin.
Thanks for the plugin.

@matu3ba matu3ba added the enhancement New feature or request label Jun 4, 2024
@stevearc stevearc added the P2 Not a priority. PRs welcome label Jun 25, 2024
@MrDwarf7
Copy link

Also requesting this - Where I work a lot of small documents are stored via UNC paths and being unable to use Nvim for navigation means either requiring direct access to a file (ie: :Oil myfile.txt) to move between them, or directly from the CLI, requiring to close nvim.

@jeremyhaugen jeremyhaugen linked a pull request Oct 13, 2024 that will close this issue
@tox2ik
Copy link

tox2ik commented Oct 22, 2024

I was looking for SMB or samba shares or network drive / share and could not find this issue, but I did find the PR with a potential fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 Not a priority. PRs welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants