summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/edit.c b/src/edit.c
index 8c5cec3a7..a152d8449 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -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';