diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-18 22:55:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-18 22:55:30 +0800 |
commit | 647da34bbd4cf19a4bcc11899df24e00d6b8fcbe (patch) | |
tree | c67598df97c9c131eee44eebe8b9dea6c05a9604 /src | |
parent | 67df3347fd1e637f643b35239f7a20ac813ee588 (diff) | |
download | rneovim-647da34bbd4cf19a4bcc11899df24e00d6b8fcbe.tar.gz rneovim-647da34bbd4cf19a4bcc11899df24e00d6b8fcbe.tar.bz2 rneovim-647da34bbd4cf19a4bcc11899df24e00d6b8fcbe.zip |
fix: assert failure when changing 'ut' while waiting for CursorHold (#20241)
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/input.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 8fc4a5dce5..fc7390a303 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -133,7 +133,7 @@ int os_inchar(uint8_t *buf, int maxlen, int ms, int tb_change_cnt, MultiQueue *e } } else { uint64_t wait_start = os_hrtime(); - assert((int)p_ut >= cursorhold_time); + cursorhold_time = MIN(cursorhold_time, (int)p_ut); if ((result = inbuf_poll((int)p_ut - cursorhold_time, events)) == kInputNone) { if (read_stream.closed && silent_mode) { // Drained eventloop & initial input; exit silent/batch-mode (-es/-Es). @@ -148,7 +148,6 @@ int os_inchar(uint8_t *buf, int maxlen, int ms, int tb_change_cnt, MultiQueue *e } } else { cursorhold_time += (int)((os_hrtime() - wait_start) / 1000000); - cursorhold_time = MIN(cursorhold_time, (int)p_ut); } } |