diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-25 09:19:42 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2023-08-25 09:19:42 +0200 |
| commit | 8016ae283bd6a62a55906e2bf0c6c3f2cbf12afb (patch) | |
| tree | 5bee02d334591d14594ba444acd58d9fe6a34c0c /extensions | |
| parent | 416d7360e7a18ef8a7697e63a6fe75a437f4b145 (diff) | |
corfu-popupinfo--show: Show error only when manually toggling the popup
Diffstat (limited to 'extensions')
| -rw-r--r-- | extensions/corfu-popupinfo.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/extensions/corfu-popupinfo.el b/extensions/corfu-popupinfo.el index fdf02ee..80b87ed 100644 --- a/extensions/corfu-popupinfo.el +++ b/extensions/corfu-popupinfo.el @@ -185,6 +185,7 @@ all values are in pixels relative to the origin. See (or (and (bufferp (car loc)) (car loc)) (get-file-buffer (car loc)) (let ((inhibit-message t) + (message-log-max nil) (inhibit-redisplay t) (enable-dir-local-variables nil) (enable-local-variables :safe) @@ -215,8 +216,8 @@ all values are in pixels relative to the origin. See (when-let ((fun (plist-get corfu--extra :company-doc-buffer)) (res (save-excursion (let ((inhibit-message t) - (inhibit-redisplay t) (message-log-max nil) + (inhibit-redisplay t) ;; Reduce print length for elisp backend (#249) (print-level 3) (print-length (* corfu-popupinfo-max-width @@ -355,10 +356,6 @@ form (X Y WIDTH HEIGHT DIR)." (set (make-local-variable (car var)) (cdr var))) (when-let ((m (memq 'corfu-default (alist-get 'default face-remapping-alist)))) (setcar m 'corfu-popupinfo))) - (unless (eq corfu-popupinfo--toggle 'init) - (message "No %s available for `%s'" - (car (last (split-string (symbol-name corfu-popupinfo--function) "-+"))) - candidate)) (corfu-popupinfo--hide) (setq cand-changed nil coords-changed nil))) (when (or cand-changed coords-changed) @@ -444,7 +441,12 @@ See `corfu-popupinfo-scroll-up' for more details." (corfu-popupinfo--hide) (setq corfu-popupinfo--function fun corfu-popupinfo--candidate nil) - (corfu-popupinfo--show (nth corfu--index corfu--candidates)))) + (let ((cand (nth corfu--index corfu--candidates))) + (corfu-popupinfo--show cand) + (unless (corfu-popupinfo--visible-p) + (user-error "No %s available for `%s'" + (car (last (split-string (symbol-name fun) "-+"))) + cand))))) (defun corfu-popupinfo-documentation () "Show or hide documentation in popup. |
