patch 9.0.1130: unexpected output when autoloading a script
Problem: Unexpected output when autoloading a script for an interactive
operation.
Solution: Reset "KeyTyped" while loading a script and when handling a nested
function. (closes #11773)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 0e6c32c..c5b41da 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -987,7 +987,14 @@
goto theend;
}
+ // Make sure "KeyTyped" is not set, it may cause indent to be written.
+ int save_KeyTyped = KeyTyped;
+ KeyTyped = FALSE;
+
ufunc = define_function(eap, lambda_name, lines_to_free, FALSE);
+
+ KeyTyped = save_KeyTyped;
+
if (ufunc == NULL)
{
r = eap->skip ? OK : FAIL;