aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-04-01 20:50:29 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-04-01 21:50:29 +0200
commit337b6179df852350b52409fd3806e4b47ab2875b (patch)
tree9da9cd04ee35909e3cfbd8fdc5e40341b89f073f /src
parent0f6608d039ef30fe4910f78d236c4f893e95c389 (diff)
downloadrneovim-337b6179df852350b52409fd3806e4b47ab2875b.tar.gz
rneovim-337b6179df852350b52409fd3806e4b47ab2875b.tar.bz2
rneovim-337b6179df852350b52409fd3806e4b47ab2875b.zip
'pastetoggle': support value >1 char (#6421)
If we `set pastetoggle=abcde`, and manually type it, then `vgetorpeek()` sees part of the option before it has all been inserted into the typebuffer. To signify this it sets `keylen = KEYLEN_PART_KEY`, but the condition about whether to return the current key from `vgetorpeek()` only checks for `keylen = KEYLEN_PART_MAP`. Add a check for `KEYLEN_PART_KEY` to account for the `'pastetoggle'` option.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 7143819e21..b83681ad01 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1903,7 +1903,7 @@ static int vgetorpeek(int advance)
}
if ((mp == NULL || max_mlen >= mp_match_len)
- && keylen != KEYLEN_PART_MAP) {
+ && keylen != KEYLEN_PART_MAP && keylen != KEYLEN_PART_KEY) {
// No matching mapping found or found a non-matching mapping that
// matches at least what the matching mapping matched
keylen = 0;