Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Tab completion error after upgrade



On Sat, 27 Jun 2015 12:12:49 +0200
Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx> wrote:
> * Thorsten Kampe (Sat, 27 Jun 2015 12:09:11 +0200)
> 
> > The error comes from "setopt no_multifuncdef" in my .zshrc.

Ah.  This isn't Cygwin-specific at all.

MULTIFUNCDEF is turned on for completion, but that happens within
_main_complete itself, and the error is during parsing, not execution,
and functions are parsed to the end before executing.

So the simplest thing to do is just split the definitions.  I believe
these deliberately don't use the trap builtin.

diff --git a/Completion/Base/Core/_main_complete b/Completion/Base/Core/_main_complete
index c023268..9c4cfac 100644
--- a/Completion/Base/Core/_main_complete
+++ b/Completion/Base/Core/_main_complete
@@ -141,11 +141,16 @@ _completer_num=1
 
 # We assume localtraps to be in effect here ...
 integer SECONDS=0
-TRAPINT TRAPQUIT() {
+TRAPINT() {
   zle -M "Killed by signal in ${funcstack[2]} after ${SECONDS}s";
   zle -R
   return 130
 }
+TRAPQUIT() {
+  zle -M "Killed by signal in ${funcstack[2]} after ${SECONDS}s";
+  zle -R
+  return 131
+}
 
 # Call the pre-functions.
 



Messages sorted by: Reverse Date, Date, Thread, Author