From e16a3389b957071e5a23ee5f57c4f7c925d0e791 Mon Sep 17 00:00:00 2001 From: kovan Date: Fri, 13 Feb 2026 22:43:15 +0100 Subject: [PATCH] fix(agda): preserve input method in evil normal mode Evil clears `current-input-method' in normal state, storing the real method in `evil-input-method'. This breaks agda's minibuffer prompts that use `read-string' with INHERIT-INPUT-METHOD, as they inherit nil. Advise `read-from-minibuffer' and `read-string' to restore the input method from `evil-input-method' when in normal state. Fix: #5711 Co-authored-by: Claude Opus 4.6 --- modules/lang/agda/config.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/lang/agda/config.el b/modules/lang/agda/config.el index 1a9fe07ad8f..25c75c3e9ab 100644 --- a/modules/lang/agda/config.el +++ b/modules/lang/agda/config.el @@ -13,6 +13,21 @@ ;; TODO: agda2-ts-mode + ;; Fix #5711: Evil clears `current-input-method' in normal state, which + ;; prevents agda's `read-string' (with INHERIT-INPUT-METHOD) from inheriting + ;; the agda input method. Restore it from `evil-input-method'. + (when (modulep! :editor evil) + (defadvice! +agda--preserve-input-method-in-minibuffer-a (fn &rest args) + "Preserve the input method in evil normal mode for minibuffer prompts." + :around '(read-from-minibuffer read-string) + (if (and evil-input-method + (bound-and-true-p evil-local-mode) + (evil-normal-state-p)) + (with-temp-buffer + (activate-input-method evil-input-method) + (apply fn args)) + (apply fn args)))) + (map! :map agda2-mode-map :localleader "?" #'agda2-show-goals