summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2018-11-05 08:13:56 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2018-11-05 08:13:56 +0100
commit8e9a73859a5b9f9f975599032cd71b80026e024c (patch)
treead827d24c7b016dce17b301b8e3f501b668d5f42
parent63285d7fb9794376f46bb6f6045ff82535883754 (diff)
Fix cursor movement in header-line (#2108)
when persistent-help is displayed in minibuffer window with an overlay with display prop. * helm.el (helm--set-header-line): Bind locally disable-point-adjustment. (helm-hide-minibuffer-maybe): Reenable display of persistent-help instead of invisibility.
-rw-r--r--helm.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/helm.el b/helm.el
index f2481993..c1af5a0e 100644
--- a/helm.el
+++ b/helm.el
@@ -4772,6 +4772,10 @@ mode and header lines."
(defun helm--set-header-line (&optional update)
(with-selected-window (minibuffer-window)
+ (when helm-display-header-line
+ ;; Prevent cursor movement over the overlay displaying
+ ;; persistent-help in minibuffer (issue #2108).
+ (setq-local disable-point-adjustment t))
(let* ((beg (save-excursion (vertical-motion 0 (helm-window)) (point)))
(end (save-excursion (end-of-visual-line) (point)))
;; The visual line where the cursor is.
@@ -4839,8 +4843,19 @@ It has no effect if `helm-echo-input-in-header-line' is nil."
(when (with-helm-buffer helm-echo-input-in-header-line)
(let ((ov (make-overlay (point-min) (point-max) nil nil t)))
(overlay-put ov 'window (selected-window))
- (overlay-put ov 'face (let ((bg-color (face-background 'default nil)))
- `(:background ,bg-color :foreground ,bg-color)))
+ (helm-aif (and helm-display-header-line
+ (helm-attr 'persistent-help))
+ (progn
+ (overlay-put ov 'display
+ (truncate-string-to-width
+ (substitute-command-keys
+ (concat "\\<helm-map>\\[helm-execute-persistent-action]: "
+ (format "%s (keeping session)" it)))
+ (- (window-width) 1)))
+ (overlay-put ov 'face 'helm-header))
+ (overlay-put ov 'face (let ((bg-color (face-background 'default nil)))
+ `(:background ,bg-color :foreground ,bg-color))))
+
(setq cursor-type nil))))
(defun helm-show-candidate-number (&optional name)