mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
vim-patch:8.0.1806: InsertCharPre causes problems for autocomplete
Problem: InsertCharPre causes problems for autocomplete. (Lifepillar)
Solution: Check for InsertCharPre before calling vpeekc(). (Christian
Brabandt, closes vim/vim#2876)
39de952577
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user