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

With ivy-use-selectable-prompt set, can't choose empty input #1924

Closed
DWgit opened this issue Feb 7, 2019 · 1 comment
Closed

With ivy-use-selectable-prompt set, can't choose empty input #1924

DWgit opened this issue Feb 7, 2019 · 1 comment

Comments

@DWgit
Copy link

@DWgit DWgit commented Feb 7, 2019

In ivy-mode with (setq ivy-use-selectable-prompt t), completing-read does not allow ivy-previous-line to choose and accept an empty input. The only way to enter an empty input is the traditional C-M-j.

Here's a minimal test case, derived from a real-world issue with auctex:

;; raw emacs -q case
;; When REQUIRE-MATCH is t, default emacs completing-read allows empty string
(completing-read "prompt: " '("foo" "bar") nil t)

;; ivy case
(require 'ivy)
(ivy-mode 1) 
(setq ivy-use-selectable-prompt t)

;; When REQUIRE-MATCH is t, empty string can be selected with C-M-j but
;; cannot be selected with ivy-previous-line
(completing-read "prompt: " '("foo" "bar") nil t)

;; real-world example from auctex:
;;
;;   User does: C-c C-m parbox, and cannot choose an empty Position with ivy-previous-line
;;
;;   auctex::latex.el:
;;     (completing-read (TeX-argument-prompt optional prompt "Position")
;;                      '(("") ("t") ("b"))
;;                      nil t)
;;  

@abo-abo
Copy link
Owner

@abo-abo abo-abo commented Apr 8, 2019

Thanks, please test.

astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
When :require-match is t, and "" is in the collection.

Fixes abo-abo#1924
astoff added a commit to astoff/swiper that referenced this issue Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants