comparison src/ex_getln.c @ 23076:5fbac68bda23 v8.2.2084

patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character Commit: https://github.com/vim/vim/commit/0684e36a7ee0743f2889698fb8e0e14f7acae423 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Dec 3 19:54:42 2020 +0100 patch 8.2.2084: CTRL-V U doesn't work to enter a Unicode character Problem: CTRL-V U doesn't work to enter a Unicode character when modifyOtherKeys is effective. (Ken Takata) Solution: Add a flag to get_literal() for the shift key. (closes #7413)
author Bram Moolenaar <Bram@vim.org>
date Thu, 03 Dec 2020 20:00:05 +0100
parents 5a7db84713dc
children a84e7abb0c92
comparison
equal deleted inserted replaced
23075:fc0d222fcf36 23076:5fbac68bda23
2204 #endif 2204 #endif
2205 2205
2206 case Ctrl_V: 2206 case Ctrl_V:
2207 case Ctrl_Q: 2207 case Ctrl_Q:
2208 { 2208 {
2209 int prev_mod_mask = mod_mask;
2210
2211 ignore_drag_release = TRUE; 2209 ignore_drag_release = TRUE;
2212 putcmdline('^', TRUE); 2210 putcmdline('^', TRUE);
2213 no_reduce_keys = TRUE; // don't merge modifyOtherKeys 2211
2214 c = get_literal(); // get next (two) character(s) 2212 // Get next (two) character(s). Do not change any
2215 no_reduce_keys = FALSE; 2213 // modifyOtherKeys ESC sequence to a normal key for
2214 // CTRL-SHIFT-V.
2215 c = get_literal(mod_mask & MOD_MASK_SHIFT);
2216
2216 do_abbr = FALSE; // don't do abbreviation now 2217 do_abbr = FALSE; // don't do abbreviation now
2217 extra_char = NUL; 2218 extra_char = NUL;
2218 // may need to remove ^ when composing char was typed 2219 // may need to remove ^ when composing char was typed
2219 if (enc_utf8 && utf_iscomposing(c) && !cmd_silent) 2220 if (enc_utf8 && utf_iscomposing(c) && !cmd_silent)
2220 { 2221 {
2221 draw_cmdline(ccline.cmdpos, 2222 draw_cmdline(ccline.cmdpos,
2222 ccline.cmdlen - ccline.cmdpos); 2223 ccline.cmdlen - ccline.cmdpos);
2223 msg_putchar(' '); 2224 msg_putchar(' ');
2224 cursorcmd(); 2225 cursorcmd();
2225 } 2226 }
2226
2227 if ((c == ESC || c == CSI)
2228 && !(prev_mod_mask & MOD_MASK_SHIFT))
2229 // Using CTRL-V: Change any modifyOtherKeys ESC
2230 // sequence to a normal key. Don't do this for
2231 // CTRL-SHIFT-V.
2232 c = decodeModifyOtherKeys(c);
2233 } 2227 }
2234 2228
2235 break; 2229 break;
2236 2230
2237 #ifdef FEAT_DIGRAPHS 2231 #ifdef FEAT_DIGRAPHS