From 360eef0602d8c6ef12a18f0b9b0d3cca31afbd4c Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Fri, 16 Jun 2017 23:41:44 +0200 Subject: [PATCH] app/irc: fix +irc/ivy-jump-to-channel not it works when buffer-names are indented below server --- modules/app/irc/autoload/irc.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/app/irc/autoload/irc.el b/modules/app/irc/autoload/irc.el index 420139f31..fa4a15a8d 100644 --- a/modules/app/irc/autoload/irc.el +++ b/modules/app/irc/autoload/irc.el @@ -62,7 +62,14 @@ argument) is non-nil only show channels in current server." (cl-loop for buf in (circe-server-chat-buffers) unless (eq buf current-buffer) collect (format " %s" (buffer-name buf))))) - :action #'ivy--switch-buffer-action + :action #'+irc--ivy-switch-to-buffer-action :preselect (buffer-name (current-buffer)) :keymap ivy-switch-buffer-map :caller '+irc/ivy-jump-to-channel))) + +;;;###autoload +(defun +irc--ivy-switch-to-buffer-action (buffer) + (when (stringp buffer) + (if (get-buffer buffer) + (ivy--switch-buffer-action buffer) + (ivy--switch-buffer-action (s-trim-left buffer)))))