summaryrefslogtreecommitdiff
path: root/helm-misc.el
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-18 09:10:27 +0100
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2017-01-18 09:10:27 +0100
commitc4d7d5d716096e0c8a7832ca027f58b0fa19c5f5 (patch)
treef787f6e36cbe5e55c2ef2328711e0c1787311ca1 /helm-misc.el
parentea96350502a14bedf064c314581b0fd588f06244 (diff)
Use last-command to test if we are in query-replace (#1667).
* helm-misc.el (helm-minibuffer-history): Do it.
Diffstat (limited to 'helm-misc.el')
-rw-r--r--helm-misc.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/helm-misc.el b/helm-misc.el
index 9ea7c506..9cbc9a8d 100644
--- a/helm-misc.el
+++ b/helm-misc.el
@@ -317,6 +317,8 @@ Default action change TZ environment variable locally to emacs."
(cl-assert (minibuffer-window-active-p (selected-window)) nil
"Error: Attempt to use minibuffer history outside a minibuffer")
(let* ((enable-recursive-minibuffers t)
+ (query-replace-p (or (eq last-command 'query-replace)
+ (eq last-command 'query-replace-regexp)))
(elm (helm-comp-read "pattern: "
(cl-loop for i in
(symbol-value minibuffer-history-variable)
@@ -334,7 +336,7 @@ Default action change TZ environment variable locally to emacs."
:keymap helm-minibuffer-history-map
:allow-nest t)))
;; Fix issue #1667 with emacs-25+ `query-replace-from-to-separator'.
- (when (boundp 'query-replace-from-to-separator)
+ (when (and (boundp 'query-replace-from-to-separator) query-replace-p)
(let ((pos (string-match "\0" elm)))
(and pos
(add-text-properties