mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 13:38:34 +00:00
getchar: fix infinite loop due to pending events
The `inchar` function could enter an infinite loop if there are events pending to be processed when an interrupt is received.
This commit is contained in:
@@ -49,6 +49,7 @@
|
|||||||
#include "nvim/term.h"
|
#include "nvim/term.h"
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
#include "nvim/undo.h"
|
#include "nvim/undo.h"
|
||||||
|
#include "nvim/os/event.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These buffers are used for storing:
|
* These buffers are used for storing:
|
||||||
@@ -2472,6 +2473,7 @@ inchar (
|
|||||||
char_u dum[DUM_LEN + 1];
|
char_u dum[DUM_LEN + 1];
|
||||||
|
|
||||||
for (;; ) {
|
for (;; ) {
|
||||||
|
event_process(true);
|
||||||
len = ui_inchar(dum, DUM_LEN, 0L, 0);
|
len = ui_inchar(dum, DUM_LEN, 0L, 0);
|
||||||
if (len == 0 || (len == 1 && dum[0] == 3))
|
if (len == 0 || (len == 1 && dum[0] == 3))
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user