aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-06-18 00:00:51 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-27 21:19:10 +0200
commit21f0f7bca5a13fe847478ef27dc26bced9b3f3d1 (patch)
tree72f91c7794869206527eaa9497671a79aab1d3d8 /src/nvim/getchar.c
parenta851090dec8600b38d54cd65264e4146ad02b1e0 (diff)
downloadrneovim-21f0f7bca5a13fe847478ef27dc26bced9b3f3d1.tar.gz
rneovim-21f0f7bca5a13fe847478ef27dc26bced9b3f3d1.tar.bz2
rneovim-21f0f7bca5a13fe847478ef27dc26bced9b3f3d1.zip
paste: WIP #4448
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 03f64c2019..d1b4751a00 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"
@@ -1902,14 +1901,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 +1933,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;