branch: master
commit ac944ead01871bea01e95b09f18459c83ef1eae2
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
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."