aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorii14 <59243201+ii14@users.noreply.github.com>2021-12-08 17:43:58 +0100
committerGitHub <noreply@github.com>2021-12-08 09:43:58 -0700
commitdb4bc32c4aa00f17dee15e7e7593f9ec90b18242 (patch)
tree3ad0fdc2e4d7dcaeddf85cf9bea068fdda75e94c /src/nvim/lua/executor.c
parent5b117bbc75e7906b9400d1e04513b0626c9f8b74 (diff)
downloadrneovim-db4bc32c4aa00f17dee15e7e7593f9ec90b18242.tar.gz
rneovim-db4bc32c4aa00f17dee15e7e7593f9ec90b18242.tar.bz2
rneovim-db4bc32c4aa00f17dee15e7e7593f9ec90b18242.zip
fix: check for interrupt in nvim_echo, write_msg and nlua_print (#16537)
Fixes `q` in more pager, where `:highlight` can be quit out of with a single `q` keystroke, while in `:lua print(vim.inspect(vim))` it just scrolls down a page.
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index 6a8b70a158..a899ca63ac 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -521,6 +521,9 @@ static void nlua_print_event(void **argv)
const size_t len = (size_t)(intptr_t)argv[1]-1; // exclude final NUL
for (size_t i = 0; i < len;) {
+ if (got_int) {
+ break;
+ }
const size_t start = i;
while (i < len) {
switch (str[i]) {