From b002883d40a96513f5ba8906ac0efd6aa65f87b9 Mon Sep 17 00:00:00 2001 From: Benjamin Andresen Date: Fri, 16 Jun 2017 23:14:50 +0200 Subject: [PATCH] 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.