app/irc: fix +irc/ivy-jump-to-channel

not it works when buffer-names are indented below server
This commit is contained in:
Benjamin Andresen 2017-06-16 23:41:44 +02:00
parent b002883d40
commit 360eef0602

View file

@ -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)))))