[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c1b9f5a 39/63: Allow "M-o j" to switch to virtual buffers
From: |
Oleh Krehel |
Subject: |
[elpa] master c1b9f5a 39/63: Allow "M-o j" to switch to virtual buffers in other window |
Date: |
Fri, 21 Aug 2015 12:08:41 +0000 |
branch: master
commit c1b9f5a0f41c88d115d46f5dd3322a1586c2b51b
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Allow "M-o j" to switch to virtual buffers in other window
* ivy.el (ivy--switch-buffer-other-window-action): New defun.
(ivy-set-actions): Use `ivy--switch-buffer-other-window-action' instead
of `switch-to-buffer-other-window'.
---
ivy.el | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/ivy.el b/ivy.el
index 28463b7..5535e1d 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1550,6 +1550,17 @@ BUFFER may be a string or nil."
(switch-to-buffer
buffer nil 'force-same-window)))))
+(defun ivy--switch-buffer-other-window-action (buffer)
+ "Switch to BUFFER in other window.
+BUFFER may be a string or nil."
+ (if (zerop (length buffer))
+ (switch-to-buffer-other-window ivy-text)
+ (let ((virtual (assoc buffer ivy--virtual-buffers)))
+ (if (and virtual
+ (not (get-buffer buffer)))
+ (find-file-other-window (cdr virtual))
+ (switch-to-buffer-other-window buffer)))))
+
(defvar ivy-switch-buffer-map (make-sparse-keymap))
(ivy-set-actions
@@ -1560,7 +1571,7 @@ BUFFER may be a string or nil."
(ivy--reset-state ivy-last))
"kill")
("j"
- switch-to-buffer-other-window
+ ivy--switch-buffer-other-window-action
"other")))
(defun ivy-switch-buffer ()
- [elpa] master 3464362 33/63: Add actions for counsel-describe-variable, (continued)
- [elpa] master 3464362 33/63: Add actions for counsel-describe-variable, Oleh Krehel, 2015/08/21
- [elpa] master 31d664a 32/63: ivy.el (ivy-dispatching-done): Add a trailing newline, Oleh Krehel, 2015/08/21
- [elpa] master 107ebff 34/63: Add actions for counsel-describe-function, Oleh Krehel, 2015/08/21
- [elpa] master 2fbcfb9 29/63: ivy.el (ivy--preselect-index): Add matcher to arglist, Oleh Krehel, 2015/08/21
- [elpa] master cb0cf02 35/63: ivy.el (ivy-call): Remove with-selected-window, Oleh Krehel, 2015/08/21
- [elpa] master 08bd5b4 25/63: counsel.el (counsel-variable-list): Add, Oleh Krehel, 2015/08/21
- [elpa] master ae77d93 36/63: counsel.el (counsel-org-tag): Replace org-set-tags, Oleh Krehel, 2015/08/21
- [elpa] master 1e483c5 37/63: Fixup counsel-org-tag, Oleh Krehel, 2015/08/21
- [elpa] master a9ff1f1 38/63: counsel.el (counsel-org-change-tags): Improve removing tags, Oleh Krehel, 2015/08/21
- [elpa] master 5ae677c 41/63: Simplify counsel-git-grep logic, Oleh Krehel, 2015/08/21
- [elpa] master c1b9f5a 39/63: Allow "M-o j" to switch to virtual buffers in other window,
Oleh Krehel <=
- [elpa] master f71a562 40/63: Fix "DEL" generating a "Quit" sometimes for counsel-git-grep, Oleh Krehel, 2015/08/21
- [elpa] master 36e8fe3 46/63: counsel.el (counsel-org-tag): No need to be at heading, Oleh Krehel, 2015/08/21
- [elpa] master acf4485 42/63: ivy.el (ivy--exhibit): Check if in post-command-hook, Oleh Krehel, 2015/08/21
- [elpa] master 8a06271 43/63: Update :dynamic-collection to be a boolean, Oleh Krehel, 2015/08/21
- [elpa] master 2bd9118 44/63: counsel.el (counsel-ag): New command, Oleh Krehel, 2015/08/21
- [elpa] master 8152577 45/63: counsel.el (counsel-recoll): New command, Oleh Krehel, 2015/08/21
- [elpa] master 6ab519f 48/63: counsel.el (counsel-org-tag): Delete dups, Oleh Krehel, 2015/08/21
- [elpa] master e7d778b 47/63: counsel.el (counsel-recoll): Simplify, Oleh Krehel, 2015/08/21
- [elpa] master 5b61577 49/63: Use recoll -t instead of recollq, Oleh Krehel, 2015/08/21
- [elpa] master 8d82b98 51/63: swiper.el (swiper-from-isearch): New command, Oleh Krehel, 2015/08/21