diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-21 20:04:22 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-21 20:04:22 +0100 |
commit | ec2da36ca48b40c0654b32a8d2c9f52e796daa5e (patch) | |
tree | f6dab5f51ef8f54af0f45fa5b79129638f3c2737 /src/normal.c | |
parent | 41baa7983aa81b0343b053e6a672cf8224a10245 (diff) | |
download | vim-ec2da36ca48b40c0654b32a8d2c9f52e796daa5e.zip |
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.
Diffstat (limited to 'src/normal.c')
-rw-r--r-- | src/normal.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/normal.c b/src/normal.c index 8724553a9..2b867bb19 100644 --- a/src/normal.c +++ b/src/normal.c @@ -426,6 +426,7 @@ static const struct nv_cmd #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 @@ add_to_showcmd(int c) 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 @@ nv_esc(cmdarg_T *cap) /* * 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 @@ nv_edit(cmdarg_T *cap) /* 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 @@ nv_edit(cmdarg_T *cap) 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 @@ nv_edit(cmdarg_T *cap) invoke_edit(cap, FALSE, cap->cmdchar, FALSE); } + else if (cap->cmdchar == K_PS) + /* drop the pasted text */ + bracketed_paste(PASTE_INSERT, TRUE, NULL); } /* |