0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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)
This commit is contained in:
Bram Moolenaar
2020-12-03 19:54:42 +01:00
parent af0df47a76
commit 0684e36a7e
7 changed files with 35 additions and 30 deletions

View File

@@ -1534,7 +1534,6 @@ ins_ctrl_v(void)
{
int c;
int did_putchar = FALSE;
int prev_mod_mask = mod_mask;
// may need to redraw when no more chars available now
ins_redraw(FALSE);
@@ -1550,7 +1549,9 @@ ins_ctrl_v(void)
add_to_showcmd_c(Ctrl_V);
#endif
c = get_literal();
// Do not change any modifyOtherKeys ESC sequence to a normal key for
// CTRL-SHIFT-V.
c = get_literal(mod_mask & MOD_MASK_SHIFT);
if (did_putchar)
// when the line fits in 'columns' the '^' is at the start of the next
// line and will not removed by the redraw
@@ -1559,11 +1560,6 @@ ins_ctrl_v(void)
clear_showcmd();
#endif
if ((c == ESC || c == CSI) && !(prev_mod_mask & MOD_MASK_SHIFT))
// Using CTRL-V: Change any modifyOtherKeys ESC sequence to a normal
// key. Don't do this for CTRL-SHIFT-V.
c = decodeModifyOtherKeys(c);
insert_special(c, FALSE, TRUE);
#ifdef FEAT_RIGHTLEFT
revins_chars++;
@@ -1845,9 +1841,11 @@ del_char_after_col(int limit_col UNUSED)
* A one, two or three digit decimal number is interpreted as its byte value.
* If one or two digits are entered, the next character is given to vungetc().
* For Unicode a character > 255 may be returned.
* If "noReduceKeys" is TRUE do not change any modifyOtherKeys ESC sequence
* into a normal key, return ESC.
*/
int
get_literal(void)
get_literal(int noReduceKeys)
{
int cc;
int nc;
@@ -1878,6 +1876,9 @@ get_literal(void)
for (;;)
{
nc = plain_vgetc();
if ((nc == ESC || nc == CSI) && !noReduceKeys)
nc = decodeModifyOtherKeys(nc);
#ifdef FEAT_CMDL_INFO
if (!(State & CMDLINE) && MB_BYTE2LEN_CHECK(nc) == 1)
add_to_showcmd(nc);
@@ -3812,8 +3813,7 @@ ins_ctrl_o(void)
{
if (State & VREPLACE_FLAG)
restart_edit = 'V';
else
if (State & REPLACE_FLAG)
else if (State & REPLACE_FLAG)
restart_edit = 'R';
else
restart_edit = 'I';