tumashu / vertico-posframe

GNU General Public License v3.0
114 stars 16 forks source link

With evil: does not close on escape on first use, but on following uses #10

Open promisedlandt opened 2 years ago

promisedlandt commented 2 years ago

Hello,

Reproduction steps, installed are evil, vertico, vertico-posframe:

This happens only with evil, without evil it closes on esc esc esc.

Video: vertico-posframe-escape

My minimal config:

(setq load-path (append load-path
                        (list
                          "~/.emacs.d/bundle/use-package"
                          "~/.emacs.d/bundle/evil"
                          "~/.emacs.d/bundle/vertico"
                          "~/.emacs.d/bundle/posframe"
                          "~/.emacs.d/bundle/vertico-posframe"
                          )
                        ))
(require 'use-package)

(use-package evil
             :config
             (evil-mode 1)
             )

(use-package vertico
             :config
             (vertico-mode)
             )

(use-package vertico-posframe
             :init
             (setq vertico-posframe-display-functions-alist '((t . vertico-posframe-display-at-frame-center)))
             :config
             (vertico-posframe-mode 1)
             )
tumashu commented 2 years ago

I do not use evil, and hard understand what is this problem :-\

promisedlandt commented 2 years ago

Sorry, I have updated with better reproduction steps. But if you don't use evil, maybe we should close the issue?

It's interesting that ivy-posframe works as expected, but vertico-posframe does not.

tumashu commented 2 years ago

disable vertico-posframe, and try again, does the second step have expected behavor?

tumashu commented 2 years ago

disable vertico-posframe, and try again, does the second step have expected behavor?

promisedlandt commented 2 years ago

Without vertico posframe, the second step has the expected behaviour.

tumashu commented 2 years ago

I have try (evil-mode 1) in my machine, I find when I M-x, I need type ESC ESC ESC to exit in second step, I think we need a emacser who know better evil to find the problem, a hack way is let the below code eval after type ESC, maybe advice maybe hook.

(when (posframe-workable-p)
    (posframe-hide vertico-posframe--buffer))
tumashu commented 2 years ago

I have try (evil-mode 1) in my machine, I find when I M-x, I need type ESC ESC ESC to exit, I think we need a emacser who know better evil to find the problem, a hack way is let the below code eval after type ESC:

(when (posframe-workable-p)
    (posframe-hide vertico-posframe--buffer))
promisedlandt commented 2 years ago

In step 5, do you also need ESC ESC ESC? Or just ESC?

tumashu commented 2 years ago

ESC ESC ESC, by the way, do you test evil and vertico-posframe in emacs -Q?

tumashu commented 2 years ago

ESC ESC ESC, by the way, do you test evil and vertico-posframe in emacs -Q?

promisedlandt commented 2 years ago

do you test evil and vertico-posframe in emacs -Q?

Yes, I have the configuration from the issue in vertico.el, and start with emacs -Q --load ~/.emacs.d/vertico.el

But I noticed I missed the first line when copying, (global-set-key (kbd "<escape>") 'keyboard-escape-quit). Without this line, I also need esc esc esc in step 5, but step 2 is still the same.

tumashu commented 2 years ago

Maybe your (global-set-key (kbd "") 'keyboard-escape-quit) has been override by evil when you first enter minibuffer.

tumashu commented 2 years ago

Maybe your (global-set-key (kbd "") 'keyboard-escape-quit) has been override by evil when you first enter minibuffer. for ESC is special for evil.

tumashu commented 2 years ago

i do not know how to fix this issue, and wait other emacser’s help.

promisedlandt commented 2 years ago

I have the problem in step 2 regardless of the keybinding. But it's fine to not have a solution, I use ivy with ivy-posframe and it's great, thanks! :smile:

zhenwenc commented 2 years ago

I also encountered the same issue, my solution is to use emacs state in minibuffer:

(evil-set-initial-state 'minibuffer-mode 'emacs)
promisedlandt commented 2 years ago

I also encountered the same issue, my solution is to use emacs state in minibuffer:

(evil-set-initial-state 'minibuffer-mode 'emacs)

Thanks, it works for me too.

@tumashu Should I close this issue since there is a workaround now?

tumashu commented 2 years ago

@promisedlandt i suggest keep open, maybe other solutions found.