summaryrefslogtreecommitdiff
path: root/helm.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-07-23 18:32:09 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-07-23 18:32:09 +0200
commitc70fa9d9303d4b1ad4a75c6c90eb040024a505a4 (patch)
tree808b728a0a7c9e7acba5ffd1f170cddaed6c6acd /helm.el
parent817dd9da836e2139fa1559ca02bb3bd8e4b397c3 (diff)
Allow helm-follow-mode following current candidate after updating(fix #1568).
* helm.el (helm-follow-follow-on-update): New user var. (helm--update-move-first-line): Use it. (helm-output-filter--post-process): Maybe run persistent.
Diffstat (limited to 'helm.el')
-rw-r--r--helm.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/helm.el b/helm.el
index 14c91a59..29cce4e3 100644
--- a/helm.el
+++ b/helm.el
@@ -477,6 +477,11 @@ To make this behavior persistent across emacs sessions, set the
:group 'helm
:type 'boolean)
+(defcustom helm-follow-follow-on-update nil
+ "Follow current candidate after each update when `helm-follow-mode' is enabled."
+ :group 'helm
+ :type 'boolean)
+
(defcustom helm-prevent-escaping-from-minibuffer t
"Prevent escape from minibuffer during the helm session."
:group 'helm
@@ -3287,7 +3292,9 @@ to a particular place after finishing update."
(defun helm--update-move-first-line ()
"Goto first line of `helm-buffer'."
(goto-char (point-min))
- (helm-move-selection-common :where 'line :direction 'next :follow nil))
+ (helm-move-selection-common :where 'line
+ :direction 'next
+ :follow helm-follow-follow-on-update))
(defun helm-force-update (&optional preselect)
"Force recalculation and update of candidates.
@@ -3462,6 +3469,8 @@ this additional info after the source name by overlay."
(with-selected-window it
(helm-skip-noncandidate-line 'next)
(helm-mark-current-line)
+ (when helm-follow-follow-on-update
+ (helm-follow-execute-persistent-action-maybe))
(helm-display-mode-line (helm-get-current-source))
(helm-log-run-hook 'helm-after-update-hook))))