Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.14k stars 180 forks source link

No feedback when there is a permission denied #1052

Closed dreamerlzl closed 7 months ago

dreamerlzl commented 7 months ago

Describe your question, feature request, or bug.

Currently, it seems that once there's a file/directory the current user has no access to, Leaderf! rg will fail to find any matches in other files which are actually accessible.

Steps to reproduce

  1. Under a directory say test, create a file/dir that the current user can not read (say, drwx------ and owned by root)
  2. Also, create a text file like echo hello > a.txt under test
  3. Open neovim under test and try to use Leaderf! rg, no matter what input you give, no results or errors would be shown.

Actual behaviour

No output at all, users don't know what have happened.

Expected behaviour

Any error message or help info so that users can know there is a permission issue.

dreamerlzl commented 7 months ago

and if you directly type rg under test, you can clearly see there is a permission denied error while the matches for other accessiable files are still working

Yggdroot commented 7 months ago

Can not reproduce. I can always get

Messages maintainer: The Vim Project                                                                                                                                                         
File "/home/yggdroot/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/cli.py", line 698, in input^@    callback()^@  File "/home/yggdroot/.vim/plugged/LeaderF/autoload/leaderf/python/le
aderf/manager.py", line 70, in deco^@    func(self, *args, **kwargs)^@  File "/home/yggdroot/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 2852, in _workInIdle^@   
 raise self._read_content_exception[1]^@  File "/home/yggdroot/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/manager.py", line 2825, in _readContent^@    for line in content:^@  File
 "/home/yggdroot/.vim/plugged/LeaderF/autoload/leaderf/python/leaderf/asyncExecutor.py", line 209, in __next__^@    return next(self._g)^@  File "/home/yggdroot/.vim/plugged/LeaderF/autoloa
d/leaderf/python/leaderf/asyncExecutor.py", line 106, in read^@    raise Exception(lfBytes2Str(err) + lfBytes2Str(err, encoding))^@Exception: test.txt: Permission denied (os error 13)^@test
.txt: Permission denied (os error 13)
dreamerlzl commented 7 months ago

ok, sorry for the bothering. It seems that this error is a kind: echo message defined by :h ui-messages and is filtered out by my noice plugin.

dreamerlzl commented 7 months ago

Still, can we show other matches despite the permission denied error? Because if you execute the rg in terminal outside neovim, it will still show other accessible matches.

Yggdroot commented 7 months ago

Add --no-messages.