-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
find-file selects first candidate when on tramp home dir #193
Comments
This seems indeed to be the case. I assume the problem is the same as in #174. The file completion table reports a wrong completion boundary. See the bug I've reported https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53053. Maybe it is not exactly this issue but it is at least related. The issue is an edge case, so I assume it is considered low priority by upstream and not yet fixed there.
For example if you enter some part of a file name, then the substring is not a valid file name. In this case Vertico selects the topmost file and not the prompt such that you can navigate quickly to this file. Only if the prompt is a valid path itself it is selected such that you can easily open directories. If you want to change the logic of Lines 440 to 453 in 1bd5438
|
In case you want to report the bug upstream: (completion-boundaries "/sudo::~/" #'read-file-name-internal nil "") ;; (8 . 0)
(completion-boundaries "/sudo::/" #'read-file-name-internal nil "") ;; (8 . 0) The return value is in both case (EDIT: I sent a mail to the aforementioned bug report, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=53053.) |
Oh the tidy behavior on my end is because I have So rn I have to either change how vertico works or wait for the upstream fix? I was hoping there would be an easier general way to not auto-select candidates when nothing has been typed. |
You can use an advice or more complicated variants of that which overwrite the logic from (defun vertico--reset-index (&rest _)
(setq vertico--index -1))
(advice-add #'vertico--update-candidates :after #'vertico--reset-index) |
So I've looked at these issues: #192 #156
And it looks like
find-file
completion should initially select the prompt if "the prompt shows a complete and valid file path". However, when connecting to a remote host, this leads to a path such as:/ssh:user@hostname:~/
which I guess is not considered "complete and valid file path" for some reason?Personally when it comes to
find-file
I always want the prompt to be initially selected to take advantage ofvertico-directory-tidy
at all times. Which makes me wonder why there's the conditional of if "the prompt shows a complete and valid file path". When would that not be the case? Doesn'tfind-file
always have the current directory as the prompt which means it's always complete and valid?The text was updated successfully, but these errors were encountered: