diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-28 01:56:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-28 01:56:02 +0200 |
commit | 82d52b229df711b710862ce772603ea55113a32e (patch) | |
tree | c097dd598d961b9090a682cf8267ca615d42b592 /src/nvim/getchar.c | |
parent | 3c9c64d9dd486598f36c597da1eaffebb3bf4cef (diff) | |
parent | 3157baed83b7e94f2ff92e6fd97e85dab41a1c94 (diff) | |
download | rneovim-82d52b229df711b710862ce772603ea55113a32e.tar.gz rneovim-82d52b229df711b710862ce772603ea55113a32e.tar.bz2 rneovim-82d52b229df711b710862ce772603ea55113a32e.zip |
Merge #4448 'paste: redesign'
fix #3447
fix #3566
fix #7066
fix #7212
fix #7273
fix #7455
fix #10415
NA vim-patches:
vim-patch:8.1.1198
vim-patch:8.1.0224
vim-patch:8.0.1299
vim-patch:8.0.0569
vim-patch:8.0.0303
vim-patch:8.0.0296
vim-patch:8.0.0244
vim-patch:8.0.0238
vim-patch:8.0.0232
vim-patch:8.0.0231
vim-patch:8.0.0230
vim-patch:8.0.0210
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r-- | src/nvim/getchar.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 03f64c2019..0ef0c852a4 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -151,7 +151,6 @@ static char_u typebuf_init[TYPELEN_INIT]; /* initial typebuf.tb_buf */ static char_u noremapbuf_init[TYPELEN_INIT]; /* initial typebuf.tb_noremap */ static size_t last_recorded_len = 0; // number of last recorded chars -static const uint8_t ui_toggle[] = { K_SPECIAL, KS_EXTRA, KE_PASTE, 0 }; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "getchar.c.generated.h" @@ -524,15 +523,12 @@ void AppendToRedobuff(const char *s) } } -/* - * Append to Redo buffer literally, escaping special characters with CTRL-V. - * K_SPECIAL and CSI are escaped as well. - */ -void -AppendToRedobuffLit ( - char_u *str, - int len /* length of "str" or -1 for up to the NUL */ -) +/// Append to Redo buffer literally, escaping special characters with CTRL-V. +/// K_SPECIAL and CSI are escaped as well. +/// +/// @param str String to append +/// @param len Length of `str` or -1 for up to the NUL. +void AppendToRedobuffLit(const char_u *str, int len) { if (block_redo) { return; @@ -1902,14 +1898,8 @@ static int vgetorpeek(int advance) } } - // Check for a key that can toggle the 'paste' option - if (mp == NULL && (State & (INSERT|NORMAL))) { - bool match = typebuf_match_len(ui_toggle, &mlen); - if (!match && mlen != typebuf.tb_len && *p_pt != NUL) { - // didn't match ui_toggle_key and didn't try the whole typebuf, - // check the 'pastetoggle' - match = typebuf_match_len(p_pt, &mlen); - } + if (*p_pt != NUL && mp == NULL && (State & (INSERT|NORMAL))) { + bool match = typebuf_match_len(p_pt, &mlen); if (match) { // write chars to script file(s) if (mlen > typebuf.tb_maplen) { @@ -1940,8 +1930,7 @@ static int vgetorpeek(int advance) } if ((mp == NULL || max_mlen >= mp_match_len) - && keylen != KEYLEN_PART_MAP - && !(keylen == KEYLEN_PART_KEY && c1 == ui_toggle[0])) { + && keylen != KEYLEN_PART_MAP) { // No matching mapping found or found a non-matching mapping that // matches at least what the matching mapping matched keylen = 0; |