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

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

[elpa] master ac944ea 325/348: ivy.el: Remove with-ivy-window


From: Oleh Krehel
Subject: [elpa] master ac944ea 325/348: ivy.el: Remove with-ivy-window
Date: Sat, 8 Apr 2017 11:04:23 -0400 (EDT)

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

    ivy.el: Remove with-ivy-window
    
    Rely on `ivy-call' selecting the correct window
    Fixes #928
---
 ivy.el | 49 ++++++++++++++++++++++++-------------------------
 1 file changed, 24 insertions(+), 25 deletions(-)

diff --git a/ivy.el b/ivy.el
index a4f9652..880bd59 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1801,31 +1801,30 @@ INHERIT-INPUT-METHOD is currently ignored."
   "Insert STR, erasing the previous one.
 The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
   (when (stringp str)
-    (with-ivy-window
-      (let ((fake-cursors (and (featurep 'multiple-cursors)
-                               (mc/all-fake-cursors)))
-            (pt (point))
-            (beg ivy-completion-beg)
-            (end ivy-completion-end))
-        (when ivy-completion-beg
-          (delete-region
-           ivy-completion-beg
-           ivy-completion-end))
-        (setq ivy-completion-beg
-              (move-marker (make-marker) (point)))
-        (insert (substring-no-properties str))
-        (setq ivy-completion-end
-              (move-marker (make-marker) (point)))
-        (save-excursion
-          (dolist (cursor fake-cursors)
-            (goto-char (overlay-start cursor))
-            (delete-region (+ (point) (- beg pt))
-                           (+ (point) (- end pt)))
-            (insert (substring-no-properties str))
-            ;; manually move the fake cursor
-            (move-overlay cursor (point) (1+ (point)))
-            (move-marker (overlay-get cursor 'point) (point))
-            (move-marker (overlay-get cursor 'mark) (point))))))))
+    (let ((fake-cursors (and (featurep 'multiple-cursors)
+                             (mc/all-fake-cursors)))
+          (pt (point))
+          (beg ivy-completion-beg)
+          (end ivy-completion-end))
+      (when ivy-completion-beg
+        (delete-region
+         ivy-completion-beg
+         ivy-completion-end))
+      (setq ivy-completion-beg
+            (move-marker (make-marker) (point)))
+      (insert (substring-no-properties str))
+      (setq ivy-completion-end
+            (move-marker (make-marker) (point)))
+      (save-excursion
+        (dolist (cursor fake-cursors)
+          (goto-char (overlay-start cursor))
+          (delete-region (+ (point) (- beg pt))
+                         (+ (point) (- end pt)))
+          (insert (substring-no-properties str))
+          ;; manually move the fake cursor
+          (move-overlay cursor (point) (1+ (point)))
+          (move-marker (overlay-get cursor 'point) (point))
+          (move-marker (overlay-get cursor 'mark) (point)))))))
 
 (defun ivy-completion-common-length (str)
   "Return the length of the first 'completions-common-part face in STR."



reply via email to

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