diff options
| author | jixiuf <jixiuf@qq.com> | 2021-04-09 23:58:06 +0800 |
|---|---|---|
| committer | jixiuf <jixiuf@qq.com> | 2021-04-09 23:58:06 +0800 |
| commit | 2b1392cb2b14ec5bd0b7355197d5f353aa5d3983 (patch) | |
| tree | 552d9f90b68d3694794b2714e6a149ea449acf42 /vterm.el | |
| parent | 971ea53b847dd30a5e067cdd665b5054577d5e98 (diff) | |
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
Diffstat (limited to 'vterm.el')
| -rw-r--r-- | vterm.el | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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." |
