• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン6837d2c14dee7783f533cf3d292600a571c131b1 (tree)
日時2022-01-19 22:00:04
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

patch 8.2.4143: MS-Windows: IME support for Win9x is obsolete

Commit: https://github.com/vim/vim/commit/b0b2b73dca40c26ff1f4befe5c3aad3fd4bccfad
Author: K.Takata <kentkt@csc.jp>
Date: Wed Jan 19 12:59:21 2022 +0000

patch 8.2.4143: MS-Windows: IME support for Win9x is obsolete
Problem: MS-Windows: IME support for Win9x is obsolete.
Solution: Remove the Win9x code. (Ken Takata, closes https://github.com/vim/vim/issues/9559)

変更サマリ

差分

diff -r 50d7f7e0cbd2 -r 6837d2c14dee src/gui_w32.c
--- a/src/gui_w32.c Wed Jan 19 12:30:06 2022 +0100
+++ b/src/gui_w32.c Wed Jan 19 14:00:04 2022 +0100
@@ -368,14 +368,14 @@
368368 typedef HANDLE DPI_AWARENESS_CONTEXT;
369369
370370 typedef enum DPI_AWARENESS {
371- DPI_AWARENESS_INVALID = -1,
372- DPI_AWARENESS_UNAWARE = 0,
373- DPI_AWARENESS_SYSTEM_AWARE = 1,
371+ DPI_AWARENESS_INVALID = -1,
372+ DPI_AWARENESS_UNAWARE = 0,
373+ DPI_AWARENESS_SYSTEM_AWARE = 1,
374374 DPI_AWARENESS_PER_MONITOR_AWARE = 2
375375 } DPI_AWARENESS;
376376
377-# define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
378-# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
377+# define DPI_AWARENESS_CONTEXT_UNAWARE ((DPI_AWARENESS_CONTEXT)-1)
378+# define DPI_AWARENESS_CONTEXT_SYSTEM_AWARE ((DPI_AWARENESS_CONTEXT)-2)
379379 # define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE ((DPI_AWARENESS_CONTEXT)-3)
380380 # define DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 ((DPI_AWARENESS_CONTEXT)-4)
381381 # define DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED ((DPI_AWARENESS_CONTEXT)-5)
@@ -4275,7 +4275,6 @@
42754275 # endif
42764276
42774277 static HINSTANCE hLibImm = NULL;
4278-static LONG (WINAPI *pImmGetCompositionStringA)(HIMC, DWORD, LPVOID, DWORD);
42794278 static LONG (WINAPI *pImmGetCompositionStringW)(HIMC, DWORD, LPVOID, DWORD);
42804279 static HIMC (WINAPI *pImmGetContext)(HWND);
42814280 static HIMC (WINAPI *pImmAssociateContext)(HWND, HIMC);
@@ -4289,7 +4288,6 @@
42894288 static BOOL (WINAPI *pImmSetConversionStatus)(HIMC, DWORD, DWORD);
42904289 static void dyn_imm_load(void);
42914290 #else
4292-# define pImmGetCompositionStringA ImmGetCompositionStringA
42934291 # define pImmGetCompositionStringW ImmGetCompositionStringW
42944292 # define pImmGetContext ImmGetContext
42954293 # define pImmAssociateContext ImmAssociateContext
@@ -5880,56 +5878,6 @@
58805878 }
58815879
58825880 /*
5883- * get the current composition string, in UCS-2; *lenp is the number of
5884- * *lenp is the number of Unicode characters.
5885- */
5886- static short_u *
5887-GetCompositionString_inUCS2(HIMC hIMC, DWORD GCS, int *lenp)
5888-{
5889- LONG ret;
5890- LPWSTR wbuf = NULL;
5891- char_u *buf;
5892-
5893- if (!pImmGetContext)
5894- return NULL; // no imm32.dll
5895-
5896- // Try Unicode; this will always work on NT regardless of codepage.
5897- ret = pImmGetCompositionStringW(hIMC, GCS, NULL, 0);
5898- if (ret == 0)
5899- return NULL; // empty
5900-
5901- if (ret > 0)
5902- {
5903- // Allocate the requested buffer plus space for the NUL character.
5904- wbuf = alloc(ret + sizeof(WCHAR));
5905- if (wbuf != NULL)
5906- {
5907- pImmGetCompositionStringW(hIMC, GCS, wbuf, ret);
5908- *lenp = ret / sizeof(WCHAR);
5909- }
5910- return (short_u *)wbuf;
5911- }
5912-
5913- // ret < 0; we got an error, so try the ANSI version. This will work
5914- // on 9x/ME, but only if the codepage happens to be set to whatever
5915- // we're inputting.
5916- ret = pImmGetCompositionStringA(hIMC, GCS, NULL, 0);
5917- if (ret <= 0)
5918- return NULL; // empty or error
5919-
5920- buf = alloc(ret);
5921- if (buf == NULL)
5922- return NULL;
5923- pImmGetCompositionStringA(hIMC, GCS, buf, ret);
5924-
5925- // convert from codepage to UCS-2
5926- MultiByteToWideChar_alloc(GetACP(), 0, (LPCSTR)buf, ret, &wbuf, lenp);
5927- vim_free(buf);
5928-
5929- return (short_u *)wbuf;
5930-}
5931-
5932-/*
59335881 * void GetResultStr()
59345882 *
59355883 * This handles WM_IME_COMPOSITION with GCS_RESULTSTR flag on.
@@ -5939,17 +5887,27 @@
59395887 GetResultStr(HWND hwnd, int GCS, int *lenp)
59405888 {
59415889 HIMC hIMC; // Input context handle.
5942- short_u *buf = NULL;
5890+ LONG ret;
5891+ WCHAR *buf = NULL;
59435892 char_u *convbuf = NULL;
59445893
59455894 if (!pImmGetContext || (hIMC = pImmGetContext(hwnd)) == (HIMC)0)
59465895 return NULL;
59475896
5948- // Reads in the composition string.
5949- buf = GetCompositionString_inUCS2(hIMC, GCS, lenp);
5897+ // Get the length of the composition string.
5898+ ret = pImmGetCompositionStringW(hIMC, GCS, NULL, 0);
5899+ if (ret <= 0)
5900+ return NULL;
5901+
5902+ // Allocate the requested buffer plus space for the NUL character.
5903+ buf = alloc(ret + sizeof(WCHAR));
59505904 if (buf == NULL)
59515905 return NULL;
59525906
5907+ // Reads in the composition string.
5908+ pImmGetCompositionStringW(hIMC, GCS, buf, ret);
5909+ *lenp = ret / sizeof(WCHAR);
5910+
59535911 convbuf = utf16_to_enc(buf, lenp);
59545912 pImmReleaseContext(hwnd, hIMC);
59555913 vim_free(buf);
@@ -8399,8 +8357,6 @@
83998357 if (hLibImm == NULL)
84008358 return;
84018359
8402- pImmGetCompositionStringA
8403- = (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringA");
84048360 pImmGetCompositionStringW
84058361 = (void *)GetProcAddress(hLibImm, "ImmGetCompositionStringW");
84068362 pImmGetContext
@@ -8424,8 +8380,7 @@
84248380 pImmSetConversionStatus
84258381 = (void *)GetProcAddress(hLibImm, "ImmSetConversionStatus");
84268382
8427- if ( pImmGetCompositionStringA == NULL
8428- || pImmGetCompositionStringW == NULL
8383+ if ( pImmGetCompositionStringW == NULL
84298384 || pImmGetContext == NULL
84308385 || pImmAssociateContext == NULL
84318386 || pImmReleaseContext == NULL
diff -r 50d7f7e0cbd2 -r 6837d2c14dee src/version.c
--- a/src/version.c Wed Jan 19 12:30:06 2022 +0100
+++ b/src/version.c Wed Jan 19 14:00:04 2022 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 4143,
755+/**/
754756 4142,
755757 /**/
756758 4141,
旧リポジトリブラウザで表示