aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-09-03 04:49:30 -0700
committerGitHub <noreply@github.com>2019-09-03 04:49:30 -0700
commit03be64ce2ac1bd941996024a5bd0e3f9fa974445 (patch)
tree04dd2584d0eecdf8ffa9e675a8a5c7f24c6fc89a /src/nvim/edit.c
parentdcc8fcf0b9d819357d5ec9beb36cf698e600e809 (diff)
parent7199f0b3b3e31c1c3b96d17d6f1f959d1db5ce76 (diff)
downloadrneovim-03be64ce2ac1bd941996024a5bd0e3f9fa974445.tar.gz
rneovim-03be64ce2ac1bd941996024a5bd0e3f9fa974445.tar.bz2
rneovim-03be64ce2ac1bd941996024a5bd0e3f9fa974445.zip
Merge #10921 from janlazo/vim-8.0.1768
vim-patch:8.0.{1768,1806},8.1.{46,1063}
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index ca64cc091d..16c4882975 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -5541,13 +5541,15 @@ insertchar (
// 'paste' is set)..
// Don't do this when there an InsertCharPre autocommand is defined,
// because we need to fire the event for every character.
+ // Do the check for InsertCharPre before the call to vpeekc() because the
+ // InsertCharPre autocommand could change the input buffer.
if (!ISSPECIAL(c)
&& (!has_mbyte || (*mb_char2len)(c) == 1)
+ && !has_event(EVENT_INSERTCHARPRE)
&& vpeekc() != NUL
&& !(State & REPLACE_FLAG)
&& !cindent_on()
- && !p_ri
- && !has_event(EVENT_INSERTCHARPRE)) {
+ && !p_ri) {
#define INPUT_BUFLEN 100
char_u buf[INPUT_BUFLEN + 1];
int i;