aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/getchar.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-10 17:42:14 +0800
committerGitHub <noreply@github.com>2023-05-10 17:42:14 +0800
commit5ac2e47acc999472042df4f10f8f7b5ffa72ba3e (patch)
treec0b61348936f80ade94d24db5932fc05ffb7ef36 /src/nvim/getchar.c
parent4e5061dba765df2a74ac4a8182f6e7fe21da125d (diff)
downloadrneovim-5ac2e47acc999472042df4f10f8f7b5ffa72ba3e.tar.gz
rneovim-5ac2e47acc999472042df4f10f8f7b5ffa72ba3e.tar.bz2
rneovim-5ac2e47acc999472042df4f10f8f7b5ffa72ba3e.zip
fix(redo): make redo of Lua mappings in op-pending mode work (#23566)
Diffstat (limited to 'src/nvim/getchar.c')
-rw-r--r--src/nvim/getchar.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index ca555937ab..5c1366c5b2 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -2986,7 +2986,12 @@ char *getcmdkeycmd(int promptc, void *cookie, int indent, bool do_concat)
return line_ga.ga_data;
}
-bool map_execute_lua(void)
+/// Handle a Lua mapping: get its LuaRef from typeahead and execute it.
+///
+/// @param may_repeat save the LuaRef for redoing with "." later
+///
+/// @return false if getting the LuaRef was aborted, true otherwise
+bool map_execute_lua(bool may_repeat)
{
garray_T line_ga;
int c1 = -1;
@@ -3018,6 +3023,10 @@ bool map_execute_lua(void)
}
LuaRef ref = (LuaRef)atoi(line_ga.ga_data);
+ if (may_repeat) {
+ repeat_luaref = ref;
+ }
+
Error err = ERROR_INIT;
Array args = ARRAY_DICT_INIT;
nlua_call_ref(ref, NULL, args, false, &err);