tumashu / ivy-posframe

ivy-posframe is a ivy extension, which let ivy use posframe to show its candidate menu, ivy-posframe is a **GNU ELPA** package.
414 stars 26 forks source link

When using ivy-display-function-fallback, ivy-posframe-dispatching-done cannot display hints with ivy-posframe-read-action-by-key #107

Closed K-gihu closed 3 years ago

K-gihu commented 3 years ago

问题描述

使用 ivy-display-function-fallback 的时候,使用 C-o 打开 ivy-posframe-dispatching-done 后,虽然可以正常输入命令,但提示信息会显示为一个透明的矩形框,无法正常显示。

截图

Peek 2020-12-25 23-37

复现

  1. 我设置 counsel-describe-variable 使用 ivy-display-function-fallback
    (setq ivy-posframe-display-functions-alist
      '((counsel-describe-variable . ivy-display-function-fallback)))
  2. 打开 counsel-describe-variable
  3. 使用 C-o 打开 ivy-posframe-dispatching-done
  4. 发现显示为透明矩形框

可能的原因

我看了一下 ivy-posframe-dispatching-done定义

(defun ivy-posframe-dispatching-done ()
  "Ivy-posframe's `ivy-dispatching-done'."
  (interactive)
  (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key))
    (ivy-dispatching-done)))

由于不使用 ivy-display-function-fallback 的命令没有这个问题,所以我怀疑 ivy-posframe-read-action-by-keyivy-display-function-fallback 有冲突。 在试着把他改成 ivy-hydra-read-action 之后:

(let ((ivy-read-action-function #'ivy-posframe-read-action-by-key))
    (ivy-dispatching-done)))

确实可以正常显示了。 不过,这样的话不使用 ivy-display-function-fallback 的界面就会把提示显示在 minibuffer 中,风格不一致了。

System information:

```
SYSTEM  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /bin/bash
        uname      Linux 5.9.13-arch1-1 #1 SMP PREEMPT Tue, 08 Dec 2020 12:09:55 +0000 x86_64
        path       (~/.local/bin ~/.emacs.d/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/emacs/28.0.50/x86_64-pc-linux-gnu/)
EMACS   dir        ~/.emacs.d/
        version    28.0.50
        build      12月 08, 2020
        buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games --with-sound=alsa --with-modules --without-gconf --without-gsettings --with-nativecomp --with-x-toolkit=gtk3 --without-xaw3d --without-m17n-flt --with-cairo --without-compress-install 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -g -fuse-ld=gold' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
        features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES NATIVE_COMP THREADS LIBSYSTEMD JSON PDUMPER LCMS2
        traits     (gui server-running envvar-file)
DOOM    dir        ~/.doom.d/
        version    2.0.9
        font       #
        theme      doom-one-light
        build      HEAD -> develop 0c9256411 2020-12-15 04:14:40 -0500
        elc-files  0
        modules    (:completion company (ivy +childframe) :ui deft doom doom-dashboard doom-quit hl-todo hydra nav-flash ophints (popup +defaults +all) treemacs vc-gutter vi-tilde-fringe :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors snippets word-wrap :emacs dired electric (ibuffer +icons) (undo +tree) vc :term vterm :tools biblio debugger (eval +overlay) lookup lsp magit pdf :lang (cc +lsp) emacs-lisp latex markdown (org +roam +journal +present +noter +dragndrop) sh yaml :config (default +bindings +smartparens))
        packages   ((sis) (centaur-tabs) (evil-pinyin) (evil-textobj-line) (org-noter-pdftools) (org-fragtog) (pangu-spacing) (org-roam-server) (command-log-mode) (auto-activating-snippets :recipe (:host github :repo ymarco/auto-activating-snippets)) (latex-auto-activating-snippets :recipe (:host github :repo tecosaur/LaTeX-auto-activating-snippets)) (insert-translated-name :recipe (:host github :repo manateelazycat/insert-translated-name)) (awesome-tray :recipe (:host github :repo manateelazycat/awesome-tray)) (anzu) (evil-anzu) (org-super-agenda) (anki-editor))
        unpin      (n/a)
        elpa       (n/a)
```
tumashu commented 3 years ago

(setq ivy-posframe-hide-minibuffer nil) 测试一下

K-gihu commented 3 years ago

I haven't used this package for a long time, so I will close this issue.