Created
August 30, 2012 05:36
-
-
Save kanonji/3522851 to your computer and use it in GitHub Desktop.
minttyでESC押したらMSIMEをオフにするパッチ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: termout.c | |
=================================================================== | |
--- termout.c (リビジョン 1253) | |
+++ termout.c (作業コピー) | |
@@ -3,6 +3,7 @@ | |
// Adapted from code from PuTTY-0.60 by Simon Tatham and team. | |
// Licensed under the terms of the GNU General Public License v3 or later. | |
+#include "winpriv.h" | |
#include "termpriv.h" | |
#include "win.h" | |
@@ -649,6 +650,19 @@ | |
} | |
static void | |
+manage_ime(void) | |
+{ | |
+ int onoff; | |
+ switch (term.csi_argv[0]) { | |
+ when 0: onoff = 0; | |
+ when 1: onoff = 1; | |
+ default: onoff = ImmGetOpenStatus(imc) ? 0 : 1; | |
+ } | |
+ ImmSetOpenStatus(imc, onoff); | |
+ win_set_ime_open(onoff); | |
+} | |
+ | |
+static void | |
do_csi(uchar c) | |
{ | |
term_screen *screen = &term.screen; | |
@@ -769,6 +783,8 @@ | |
} | |
else | |
do_winop(); | |
+ when 'v': | |
+ manage_ime(); | |
when 'S': /* SU: Scroll up */ | |
term_do_scroll(screen->marg_t, screen->marg_b, arg0_def1, true); | |
curs->wrapnext = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment