[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when wi
From: |
Oleh Krehel |
Subject: |
[elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed |
Date: |
Sat, 20 Jul 2019 14:57:53 -0400 (EDT) |
branch: master
commit 011626ae77dbd9dba47c4aa0cae325d6c7273e7d
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-occur-press): Improve when window config changed
Scenario:
1. In a window, `swiper-isearch' for something and `ivy-occur'.
2. Now there are 2 windows. Select some other buffer in the original window.
3. Switch to *ivy-occur* and press "f".
- before: ivy's confused and goes to some line number in the wrong buffer
- after: ivy restores the attached buffer to the window where it was
---
ivy.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 5a33cb0..cec9da2 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4642,12 +4642,16 @@ EVENT gives the mouse position."
((swiper swiper-isearch counsel-git-grep counsel-grep counsel-ag
counsel-rg)
(let ((window (ivy-state-window ivy-occur-last))
(buffer (ivy-state-buffer ivy-occur-last)))
- (when (and (or (not (window-live-p window))
- (equal window (selected-window)))
- (buffer-live-p buffer))
- (save-selected-window
- (setf (ivy-state-window ivy-occur-last)
- (display-buffer buffer))))))
+ (if (not (buffer-live-p buffer))
+ (error "Buffer was killed")
+ (cond ((or (not (window-live-p window))
+ (equal window (selected-window)))
+ (save-selected-window
+ (setf (ivy-state-window ivy-occur-last)
+ (display-buffer buffer))))
+ ((not (equal (window-buffer window) buffer))
+ (with-selected-window window
+ (switch-to-buffer buffer)))))))
((counsel-describe-function counsel-describe-variable)
(setf (ivy-state-window ivy-occur-last)
- [elpa] master 0d87297 326/399: counsel.el (counsel-open-buffer-file-externally): Cleanup, (continued)
- [elpa] master 0d87297 326/399: counsel.el (counsel-open-buffer-file-externally): Cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 7defba2 327/399: ivy.el (ivy-avy): Fix when there's a scroll, Oleh Krehel, 2019/07/20
- [elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-externally): New function, Oleh Krehel, 2019/07/20
- [elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v", Oleh Krehel, 2019/07/20
- [elpa] master 7183491 332/399: ivy.el (ivy--minibuffer-setup): Avoid extra call to ivy--exhibit, Oleh Krehel, 2019/07/20
- [elpa] master a249d15 329/399: ivy-test.el (ivy-avy): Only run if avy is installed, Oleh Krehel, 2019/07/20
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, Oleh Krehel, 2019/07/20
- [elpa] master d752db5 333/399: counsel.el (counsel-find-file-extern-extensions): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master cfb8d49 335/399: counsel.el (counsel-find-file-ignore-regexp): Add lockfiles to dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed,
Oleh Krehel <=
- [elpa] master 8db9cc1 349/399: swiper.el (swiper--add-cursor-overlay): Avoid a very wide cursor on tab chars, Oleh Krehel, 2019/07/20
- [elpa] master 40d8114 338/399: counsel.el (counsel-shell-command-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master f0a2341 337/399: counsel.el (counsel-rhythmbox): Add :require-match, Oleh Krehel, 2019/07/20
- [elpa] master 4de54f1 340/399: ivy.el (ivy-reverse-i-search-kill): Add and bind to "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 7201c0f 334/399: ivy-hydra.el (ivy-dispatching-done-hydra-exit-keys): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 935603e 310/399: ivy.el (ivy--done): Press "RET" or "C-m" to create a directory, Oleh Krehel, 2019/07/20
- [elpa] master a20c196 336/399: counsel.el (counsel-set-variable): Better annotations for options, Oleh Krehel, 2019/07/20
- [elpa] master cea24b7 339/399: counsel.el (counsel-expression-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master 9f6141f 345/399: counsel.el (counsel--browse-history): Allow to remove elements with "C-k", Oleh Krehel, 2019/07/20
- [elpa] master 673c45e 342/399: ivy.el (ivy--minibuffer-setup): Set line-spacing to nil in the minibuffer, Oleh Krehel, 2019/07/20