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

Re: Bug#236350: zsh: _prefix completer broken?



On Mar 6,  7:03pm, Oliver Kiddle wrote:
} Subject: Re: Bug#236350: zsh: _prefix completer broken?
}
} > zstyle ':completion:*' completer \
} >   _oldlist _expand _complete _match _ignored _approximate _prefix
} > 
} > However, 4.2.0-pre-3 never gets beyond trying _approximate.
} 
} This is the bug I reported in 17846.

Aha.

} For now, I moved _prefix before _approximate.

I still think the trap behavior is wrong, but as a stopgap we can do this:

Index: Completion/Base/Completer/_approximate
===================================================================
--- _approximate	7 Jan 2002 15:18:19 -0000	1.5
+++ _approximate	6 Mar 2004 23:26:05 -0000
@@ -65,7 +65,7 @@
 
     builtin compadd "$_correct_expl[@]" "$@"
   }
-  trap 'unfunction compadd' EXIT INT
+  trap 'local _x=$?; unfunction compadd; ((! $_x))' EXIT INT
 fi
 
 _comp_correct=1

This won't work in general because (( )) can only return 1 or 0, not
some arbitrary exit code, but it's fine for _approximate.



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