branch: externals/consult
commit 892ff33ffd8e63a2d0d0428fb920adea322c5b5a
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    consult-focus-lines: Add mouse support to indicator
---
 consult.el | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/consult.el b/consult.el
index 09e109cb33..3914f7b849 100644
--- a/consult.el
+++ b/consult.el
@@ -587,8 +587,13 @@ We use invalid characters outside the Unicode range.")
   "Overlays used by `consult-focus-lines'.")
 
 (defvar consult--focus-lines-indicator
-  (propertize "FOCUS" 'face 'highlight
-              'help-echo "`consult-focus-lines': \\[consult-focus-lines] 
\\`RET' to reveal.")
+  (propertize
+   "FOCUS" 'face 'highlight
+   'help-echo
+   "`consult-focus-lines': \\`mouse-1' or \\[consult-focus-lines] \\`RET' to 
reveal."
+   'local-map
+   (define-keymap "<mode-line> <down-mouse-1>"
+     (lambda () (interactive) (consult-focus-lines nil 'reveal))))
   "Mode line indicator displayed if `consult-focus-lines' is active.")
 
 ;;;; Miscellaneous helper functions
@@ -3915,18 +3920,19 @@ INITIAL is the initial input."
 
 ;;;###autoload
 (defun consult-focus-lines (filter &optional show initial)
-  "Hide or show lines using overlays.
-
-The selected lines are shown and the other lines hidden.  When called
-interactively, the lines selected are those that match the minibuffer
-input.  In order to match the inverse of the input, prefix the input
-with `! '.  With optional prefix argument SHOW reveal the hidden lines.
-Alternatively rerun the command and exit the minibuffer directly without
-input to reveal the lines.  When called from Elisp, the filtering is
-performed by a FILTER function.  If the buffer is narrowed to a region,
-the command only acts on this region.
-
-FILTER is the filter function.
+  "Show only matching lines using overlays.
+
+The buffer is not modified.  The FILTER selects the lines which are
+shown.  When called interactively, the lines selected are those that
+match the minibuffer input.  In order to match the inverse of the input,
+prefix the input with `! '.  With optional prefix argument SHOW reveal
+the hidden lines.  Alternatively rerun the command and exit the
+minibuffer directly without input to reveal the lines.  When called from
+Elisp, the filtering is performed by a FILTER function.  If the buffer
+is narrowed to a region, the command only acts on this region.
+
+FILTER is the filter function, called for each line.
+SHOW is the prefix argument, if non-nil reveal all hidden lines.
 INITIAL is the initial input."
   (interactive
    (list (lambda (pattern cands)

Reply via email to