From c19dfdfdc35cda69f13e964b26db93f63085ea49 Mon Sep 17 00:00:00 2001 From: vhqr0 Date: Sat, 8 Nov 2025 23:13:25 +0800 Subject: [PATCH 1/3] inhibit set current-input-method directly --- evil-search.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evil-search.el b/evil-search.el index c882a8ea..3bb848b6 100644 --- a/evil-search.el +++ b/evil-search.el @@ -87,12 +87,12 @@ To swap out relevant keybindings, see `evil-select-search-module' function." (evil-without-input-method-hooks ;; set the input method locally rather than globally to ensure that ;; isearch clears the input method when it's finished - (setq current-input-method evil-input-method) + (activate-input-method evil-input-method) (if forward (isearch-forward regexp-p) (isearch-backward regexp-p)) (evil-push-search-history isearch-string forward) - (setq current-input-method nil)) + (deactivate-input-method)) (when (/= (point) point) ;; position the point at beginning of the match only if the call to ;; `isearch' has really moved the point. `isearch' doesn't move the From e175d232f1be9164eb1c1c79786c59ecad81b7be Mon Sep 17 00:00:00 2001 From: vhqr0 Date: Sat, 8 Nov 2025 23:16:12 +0800 Subject: [PATCH 2/3] respect input-method state property --- evil-core.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evil-core.el b/evil-core.el index 80e84c8e..d89b752a 100644 --- a/evil-core.el +++ b/evil-core.el @@ -1279,7 +1279,7 @@ If ARG is nil, don't display a message in the echo area.%s" name doc) ',state evil-previous-state) (let ((evil-state ',state)) (evil-normalize-keymaps) - (if ',input-method + (if (evil-state-property evil-state :input-method) (activate-input-method evil-input-method) ;; BUG #475: Deactivate the current input method only ;; if there is a function to deactivate it, otherwise From 917cdfcb67ed4919992dc16aa0fdc5f2ad16203a Mon Sep 17 00:00:00 2001 From: vhqr0 Date: Sat, 8 Nov 2025 23:56:17 +0800 Subject: [PATCH 3/3] fix toggle input method --- evil-core.el | 9 +++++++-- evil-search.el | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/evil-core.el b/evil-core.el index d89b752a..320b85dd 100644 --- a/evil-core.el +++ b/evil-core.el @@ -436,13 +436,18 @@ This allows input methods to be used in normal-state." (defun evil--refresh-input-method (orig-fun &rest args) "Refresh `evil-input-method'." (cond + (isearch-mode + (apply orig-fun args)) ((not evil-local-mode) (apply orig-fun args)) ((evil-state-property evil-state :input-method) (apply orig-fun args)) (t - (let ((current-input-method evil-input-method)) - (apply orig-fun args))))) + (evil-without-input-method-hooks + (activate-input-method evil-input-method) + (apply orig-fun args) + (setq evil-input-method current-input-method) + (deactivate-input-method))))) ;; Local keymaps are implemented using buffer-local variables. ;; However, unless a buffer-local value already exists, diff --git a/evil-search.el b/evil-search.el index 3bb848b6..bfa6ae46 100644 --- a/evil-search.el +++ b/evil-search.el @@ -92,6 +92,7 @@ To swap out relevant keybindings, see `evil-select-search-module' function." (isearch-forward regexp-p) (isearch-backward regexp-p)) (evil-push-search-history isearch-string forward) + (setq evil-input-method current-input-method) (deactivate-input-method)) (when (/= (point) point) ;; position the point at beginning of the match only if the call to