patch 8.0.0210: no support for bracketed paste
Problem: Vim does not support bracketed paste, as implemented by xterm and
other terminals.
Solution: Add t_BE, t_BD, t_PS and t_PE.
diff --git a/src/normal.c b/src/normal.c
index 8724553..2b867bb 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -426,6 +426,7 @@
#ifdef FEAT_AUTOCMD
{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},
#endif
+ {K_PS, nv_edit, 0, 0},
};
/* Number of commands in nv_cmds[]. */
@@ -3858,7 +3859,7 @@
K_VER_SCROLLBAR, K_HOR_SCROLLBAR,
K_LEFTMOUSE_NM, K_LEFTRELEASE_NM,
# endif
- K_IGNORE,
+ K_IGNORE, K_PS,
K_LEFTMOUSE, K_LEFTDRAG, K_LEFTRELEASE,
K_MIDDLEMOUSE, K_MIDDLEDRAG, K_MIDDLERELEASE,
K_RIGHTMOUSE, K_RIGHTDRAG, K_RIGHTRELEASE,
@@ -9015,6 +9016,7 @@
/*
* Handle "A", "a", "I", "i" and <Insert> commands.
+ * Also handle K_PS, start bracketed paste.
*/
static void
nv_edit(cmdarg_T *cap)
@@ -9042,6 +9044,9 @@
/* Only give this error when 'insertmode' is off. */
EMSG(_(e_modifiable));
clearop(cap->oap);
+ if (cap->cmdchar == K_PS)
+ /* drop the pasted text */
+ bracketed_paste(PASTE_INSERT, TRUE, NULL);
}
else if (!checkclearopq(cap->oap))
{
@@ -9073,6 +9078,7 @@
break;
case 'a': /* "a"ppend is like "i"nsert on the next character. */
+ case K_PS: /* bracketed paste works like "a"ppend */
#ifdef FEAT_VIRTUALEDIT
/* increment coladd when in virtual space, increment the
* column otherwise, also to append after an unprintable char */
@@ -9103,6 +9109,9 @@
invoke_edit(cap, FALSE, cap->cmdchar, FALSE);
}
+ else if (cap->cmdchar == K_PS)
+ /* drop the pasted text */
+ bracketed_paste(PASTE_INSERT, TRUE, NULL);
}
/*