emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master d41cc69 086/167: Pulse after ivy-occur-press


From: Oleh Krehel
Subject: [elpa] master d41cc69 086/167: Pulse after ivy-occur-press
Date: Tue, 08 Dec 2015 10:50:08 +0000

branch: master
commit d41cc69ae15bbccb4ee11028534b8f5726691f0e
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Pulse after ivy-occur-press
    
    * ivy.el (ivy-state): New field TEXT.
    (ivy-occur): Add `ivy-text' to the name of the buffer. Also store
    `ivy-text' in `ivy-occur-last'. Might be needed in the future for a more
    specific pulse.
    (ivy-occur-press): Pulse the selected line.
---
 ivy.el |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/ivy.el b/ivy.el
index 8f993e5..d8d7592 100644
--- a/ivy.el
+++ b/ivy.el
@@ -190,6 +190,8 @@ Only \"./\" and \"../\" apply here. They appear in reverse 
order."
   window
   ;; The buffer in which `ivy-read' was called
   buffer
+  ;; The value of `ivy-text' to be used by `ivy-occur'
+  text
   action
   unwind
   re-builder
@@ -2095,13 +2097,15 @@ It's possible to have an unlimited amount of 
*ivy-occur* buffers."
    (let (caller)
      (pop-to-buffer
       (generate-new-buffer
-       (format "*ivy-occur%s*"
+       (format "*ivy-occur%s \"%s\"*"
                (if (setq caller (ivy-state-caller ivy-last))
                    (concat " " (prin1-to-string caller))
-                 ""))))
+                 "")
+               ivy-text)))
      (read-only-mode)
      (setq ivy-occur-action (ivy--get-action ivy-last))
      (setq-local ivy--directory ivy--directory)
+     (setf (ivy-state-text ivy-last) ivy-text)
      (setq ivy-occur-last ivy-last)
      (let ((inhibit-read-only t))
        (erase-buffer)
@@ -2130,11 +2134,15 @@ EVENT gives the mouse position."
 (defun ivy-occur-press ()
   "Execute action for the current candidate."
   (interactive)
-  (let ((ivy-last ivy-occur-last))
+  (require 'pulse)
+  (let* ((ivy-last ivy-occur-last)
+         (ivy-text (ivy-state-text ivy-last)))
     (funcall ivy-occur-action
              (buffer-substring
               (+ 4 (line-beginning-position))
-              (line-end-position)))))
+              (line-end-position)))
+    (with-ivy-window
+      (pulse-momentary-highlight-one-line (point)))))
 
 (defun ivy-insert-current ()
   "Make the current candidate into current input.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]