branch: elpa/helm
commit e31a81506da2087cb64239eebd630b871a5e53cf
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Do not update when doing C-k on an empty minibuffer
This change the behavior of helm--delete-minibuffer-contents-from
which was force updating for no reasons and making the intention
unclear when using it directly like in helm-select-action.
---
helm-core.el | 22 +++++++++++++---------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/helm-core.el b/helm-core.el
index d249e1bb7b..64fa9de041 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -5661,8 +5661,13 @@ If action buffer is selected, back to the Helm buffer."
(helm-subr-native-elisp-p
actions))
"Anonymous" actions))
(helm-show-action-buffer actions)
- ;; Be sure the minibuffer is entirely deleted
(bug#907).
- (helm--delete-minibuffer-contents-from "")
+ ;; Be sure the minibuffer is entirely deleted
+ ;; (bug#907). Previously this was done from
+ ;; `helm--delete-minibuffer-contents-from' which
+ ;; was itself force updating, now do it
explicitely
+ ;; from here.
+ (helm-set-pattern "" t)
+ (helm-force-update)
;; Unhide minibuffer to make visible action
prompt [1].
(with-selected-window (minibuffer-window)
(remove-overlays) (setq cursor-type t))
@@ -6625,19 +6630,18 @@ Used generally to modify current selection."
;; Giving an empty string value to FROM-STR delete all.
(let ((input (minibuffer-contents)))
(helm-reset-yank-point)
- (if (> (length input) 0)
- ;; minibuffer is not empty, delete contents from end
- ;; of FROM-STR and update.
- (progn (helm-set-pattern from-str t) (helm-update presel))
- ;; minibuffer is already empty, force update.
- (helm-force-update presel))))
+ (unless (zerop (length input))
+ ;; minibuffer is not empty, delete contents from end
+ ;; of FROM-STR and update.
+ (helm-set-pattern from-str t)
+ (helm-update presel))))
(defun helm-delete-minibuffer-contents (&optional arg)
"Delete minibuffer contents.
When `helm-delete-minibuffer-contents-from-point' is non-nil, delete
minibuffer contents from point instead of deleting all. With a prefix
ARG reverse this behaviour. When at the end of minibuffer, delete all
-but if a prefix ARG were given preselect current selection when
+but if a prefix ARG were given also preselect current selection when
updating if possible."
(interactive "P")
(with-helm-alive-p