To: vim-dev@vim.org Subject: Patch 5.6.074 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.6.074 (extra) Problem: Entering CSI directly doesn't always work, because it's recognized as the start of a special key. Mostly a problem with multi-byte in the GUI. Solution: Use K_CSI for a typed CSI character. Use for a normal CSI, for a CSI typed in the GUI. Files: runtime/doc/intro.txt, src/getchar.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c, src/gui_riscos.c, src/gui_w32.c, src/keymap.h, src/misc2.c *** ../vim-5.6.73/runtime/doc/intro.txt Sun Jan 16 14:12:56 2000 --- runtime/doc/intro.txt Tue Apr 18 21:16:32 2000 *************** *** 1,4 **** ! *intro.txt* For Vim version 5.6. Last change: 2000 Jan 10 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *intro.txt* For Vim version 5.6. Last change: 2000 Apr 18 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 370,375 **** --- 377,384 ---- backslash \ 92 *backslash* ** vertical bar | 124 ** delete 127 + command sequence intro ALT-Esc 155 ** + CSI when typed in the GUI ** end-of-line (can be , or , depends on system and 'fileformat') ** *** ../vim-5.6.73/src/getchar.c Sat Mar 25 21:29:50 2000 --- src/getchar.c Sun Apr 16 11:28:20 2000 *************** *** 1114,1119 **** --- 1114,1125 ---- continue; } #endif + #ifdef USE_GUI + /* Translate K_CSI to CSI. The special key is only used to avoid + * it being recognized as the start of a special key. */ + if (c == K_CSI) + c = CSI; + #endif } #ifdef MSDOS /* *** ../vim-5.6.73/src/gui_amiga.c Sat Dec 4 19:51:22 1999 --- src/gui_amiga.c Sun Apr 16 11:47:11 2000 *************** *** 379,388 **** break; case IDCMP_VANILLAKEY: { ! char_u string[1]; string[0] = (char_u)code; returnEvent = ev_KeyStroke; - add_to_input_buf(string,1); break; case IDCMP_RAWKEY: if (msg->Qualifier & IEQUALIFIER_LSHIFT) --- 379,397 ---- break; case IDCMP_VANILLAKEY: { ! char_u string[3]; ! string[0] = (char_u)code; + if (code == CSI) + { + /* Insert CSI as K_CSI. Untested! */ + string[1] = KS_EXTRA; + string[2] = KE_CSI; + add_to_input_buf(string, 3); + } + else + add_to_input_buf(string, 1); returnEvent = ev_KeyStroke; break; case IDCMP_RAWKEY: if (msg->Qualifier & IEQUALIFIER_LSHIFT) *** ../vim-5.6.73/src/gui_gtk_x11.c Tue Mar 28 11:58:41 2000 --- src/gui_gtk_x11.c Fri May 19 21:17:39 2000 *************** *** 633,638 **** --- 633,647 ---- trash_input_buf(); got_int = TRUE; } + + if (len == 1 && string[0] == CSI) + { + /* Turn CSI into K_CSI. */ + string[1] = KS_EXTRA; + string[2] = KE_CSI; + len = 3; + } + add