From 2b1392cb2b14ec5bd0b7355197d5f353aa5d3983 Mon Sep 17 00:00:00 2001 From: jixiuf Date: Fri, 9 Apr 2021 23:58:06 +0800 Subject: Make `vterm--self-insert` function send key that corresponds to current input method. this should fix bug of https://github.com/DogLooksGood/emacs-rime/issues/152 --- vterm.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/vterm.el b/vterm.el index f3bed19..37031d1 100644 --- a/vterm.el +++ b/vterm.el @@ -814,12 +814,16 @@ will invert `vterm-copy-exclude-prompt' for that call." (meta (memq 'meta modifiers)) (ctrl (memq 'control modifiers)) (raw-key (event-basic-type last-command-event)) - (ev-key (if input-method-function - (let ((inhibit-read-only t)) - (funcall input-method-function raw-key)) - (vector raw-key)))) - (when-let ((key (key-description ev-key))) - (vterm-send-key key shift meta ctrl))))) + (ev-keys)) + (if input-method-function + (let ((inhibit-read-only t)) + (setq ev-keys (funcall input-method-function raw-key)) + (when (listp ev-keys) + (dolist (k ev-keys) + (when-let ((key (key-description (vector k)))) + (vterm-send-key key shift meta ctrl))))) + (when-let ((key (key-description (vector raw-key)))) + (vterm-send-key key shift meta ctrl)))))) (defun vterm-send-key (key &optional shift meta ctrl) "Send KEY to libvterm with optional modifiers SHIFT, META and CTRL." -- cgit v1.0