aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-03 06:43:16 +0800
committerGitHub <noreply@github.com>2022-07-03 06:43:16 +0800
commite837f29ce6c7784340ae2cd866aa239462d3920c (patch)
treeb77391d7a4028cc34c9ffa60c8b7d40189f55a87 /src/nvim/getchar.c
parent2b04aaad945a5bf1d5feb419d0b53c421d83f394 (diff)
parent357d63f5d799aa49068ed4fdc941b7a39f775365 (diff)
downloadrneovim-e837f29ce6c7784340ae2cd866aa239462d3920c.tar.gz
rneovim-e837f29ce6c7784340ae2cd866aa239462d3920c.tar.bz2
rneovim-e837f29ce6c7784340ae2cd866aa239462d3920c.zip
Merge pull request #19212 from zeertzjq/vim-9.0.0024
vim-patch:9.0.{0024,0030}
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 6fdc10ae0b..c3dbb02dce 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1804,7 +1804,8 @@ static int handle_mapping(int *keylenp, bool *timedout, int *mapdepth)
bool is_plug_map = false;
// If typehead starts with <Plug> then remap, even for a "noremap" mapping.
- if (typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
+ if (typebuf.tb_len >= 3
+ && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL
&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA
&& typebuf.tb_buf[typebuf.tb_off + 2] == KE_PLUG) {
is_plug_map = true;