From b002883d40a96513f5ba8906ac0efd6aa65f87b9 Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Fri, 16 Jun 2017 23:14:50 +0200 Subject: [PATCH 1/2] app/irc: don't interfere with insert mode unless before prompt --- modules/app/irc/config.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 056124afa..19a876cdd 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -114,9 +114,14 @@ playback.") ;; Let `+irc/quit' and `circe' handle buffer cleanup (map! :map circe-mode-map [remap doom/kill-this-buffer] #'bury-buffer) - ;; Ensure entering insert mode will put us at the prompt. + ;; Ensure entering insert mode will put us at the prompt, + ;; unless editing after prompt marker. + (defun +irc-evil-insert () + (when (> (marker-position lui-input-marker) (point)) + (end-of-buffer))) + (add-hook! 'lui-mode-hook - (add-hook 'evil-insert-state-entry-hook #'end-of-buffer nil t))) + (add-hook 'evil-insert-state-entry-hook #'+irc-evil-insert nil t))) (after! solaire-mode ;; distinguish chat/channel buffers from server buffers. From 360eef0602d8c6ef12a18f0b9b0d3cca31afbd4c Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Fri, 16 Jun 2017 23:41:44 +0200 Subject: [PATCH 2/2] 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)))))