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

cannot jump to the selection when entering no word #566

Closed
tomoyukim opened this issue May 1, 2022 · 4 comments
Closed

cannot jump to the selection when entering no word #566

tomoyukim opened this issue May 1, 2022 · 4 comments

Comments

@tomoyukim
Copy link

Thank you for creating and maintaining really great package! This is really helpful for me.
I'm not sure this is a bug. So, let me post this as a question.

I found I cannot jump to the selected position when I don't input any word in the prompt.
For example, when I invoke consult-outline, I just scroll down without entering something and select an item, then the cursor still stays at the original position.

For an another example, I used consult-xref, if I select a candidate without a word, xref-item-location causes an error.

Debugger entered--Lisp error: (wrong-type-argument xref-item nil)
  xref-item-location(nil)
  xref-pop-to-location(nil nil)
  consult-xref(#f(compiled-function () #<bytecode -0x1b669058f0eee6a8>) ((window . #<window 15 on GeneratorProgressStatusBar.ts>) (display-action) (auto-jump)))
  xref--show-xrefs(#f(compiled-function () #<bytecode -0x1b669058f0eee6a8>) nil)
  xref--find-xrefs("LSP identifier at point." references "LSP identifier at point." nil)
  xref-find-references("LSP identifier at point.")
  funcall-interactively(xref-find-references "LSP identifier at point.")
  #<subr call-interactively>(xref-find-references nil nil)
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> xref-find-references nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (xref-find-references nil nil))
  call-interactively(xref-find-references nil nil)
  command-execute(xref-find-references)

It seems to be because consult--read returns nil.

Do I need to configure something or is this unexpected usage?
My emacs is GNU Emacs 28.1 (build 1, x86_64-apple-darwin19.6.0, NS appkit-1894.60 Version 10.15.7 (Build 19H1824)) of 2022-04-04.

@minad
Copy link
Owner

minad commented May 1, 2022

It seems you use Ido/ido-completing-read-plus as completion UI, which is not supported by Consult. Ido is an obsolete completion UI with only limited support for completing-read, therefore one needs additional packages like ido-completing-read-plus. The recommended completion UI is Vertico, see https://github.com/minad/consult#recommended-packages. There are multiple alternatives to chose from, e.g., Consult also works with Mct and the Emacs default completion UI. See also https://github.com/minad/consult#bug-reports for details regarding bug reports. Usually I need a minimal reproducible example to investigate a bug.

@minad minad closed this as completed May 1, 2022
@tomoyukim
Copy link
Author

Thank you very much for your support. Yes, I used fido-vertical-mode actually. I changed it with vertico and then it works fine for me.

@minad
Copy link
Owner

minad commented May 1, 2022

I took another look. Turns out this is a bug in minibuffer.el. completion--replace mutates the replacement string, which leads to a bug with Fido mode. I reported this in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55205.

@minad
Copy link
Owner

minad commented May 1, 2022

Just fyi the bug has been fixed in Emacs 29, see emacs-mirror/emacs@788694d. It is unclear if the bug fix will be backported to Emacs 28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants