Skip to content
New issue

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

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

Already on GitHub? # to your account

Filer: Tab on a file/directory with no permissions #500

Closed
Grueslayer opened this issue Aug 13, 2020 · 1 comment · Fixed by #504
Closed

Filer: Tab on a file/directory with no permissions #500

Grueslayer opened this issue Aug 13, 2020 · 1 comment · Fixed by #504

Comments

@Grueslayer
Copy link
Contributor

Grueslayer commented Aug 13, 2020

If you choose a directory (or even a file) which got listed and you do not have permission to and press TAB you'll see an error like

vim-clap: thread 'session-1-filer' panicked at 'called `Result::unwrap()` on an `Err` value: Permission denied (os error 13)', crates/stdio_server/src/filer.rs:94:17
vim-clap: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/', 'message': 'Permission denied (os error 13)'}
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/.Spotlight-V100/', 'message': 'Permission denied (os error 13)'}
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/', 'message': 'Permission denied (os error 13)'}
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/', 'message': 'Permission denied (os error 13)'}
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/', 'message': 'Permission denied (os error 13)'}
vim-clap: [client_handle] {'dir': '/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/.Spotlight-V100/Users/', 'message': 'Permission denied (os error 13)'}

which is okay BUT if you already can see in the log: the filer thinks it has changed to the directory and still displays the old content where you can select the same (or another) entry. This will be appended to the current path. In the example above, i multiple chose the Spotlight cache.

If you press TAB on a file where you do not have access to filer treads the filename as directory and behaves like above.

I think choosing a directory (or file) should only lead to an error without modifying the current path.

P.S. on my Windows machine, sometimes an backtrace will be displayed as file list (where you can choose of the backtrace as file/dir)

liuchengxu added a commit that referenced this issue Aug 18, 2020
- Also fix an unwrap in Rust.

Close #500
@liuchengxu
Copy link
Owner

liuchengxu commented Aug 18, 2020

#504 should be able to resolve this issue, note that you have to compile the Rust binary locally.

liuchengxu added a commit that referenced this issue Aug 20, 2020
* Let the callback also handle the error itself

- Also fix an unwrap in Rust.

Close #500

* Show the error message in the preview window

* Fix error dir

* Update CHANGELOG.md

* .

* Update CHANGELOG.md

* Close #501

* Update CHANGELOG.md

* Refine sign ensure_exists
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants