Let me summarize the problem:
In the following case, :echo does not seem to work.
noremap <silent> f :call Test()<cr>
fun! Test()
call input("OK? ")
if 1
echo "foobar\nfoo"
endif
endfun
But it works, if you change the function to:
fun! Test()
call input("OK? ")
if 1
echo "foobar\nfoo"
endif
let a = 1
endfun
The problem is, that did_endif is not correctly reset and a recursive
call of do_cmdline() changes the global variable did_endif without
being reset.
Here is a patch:
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -1537,6 +1537,8 @@
#endif
--call_depth;
+ if (did_endif)
+ did_endif = FALSE;
return retval;
}
regards,
Christian