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

Re: DEBUG trap and warn_create_global



On Mon, Nov 20, 2017 at 05:45:11PM -0800, Bart Schaefer wrote:
> On Sun, Nov 19, 2017 at 8:08 PM, Matthew Martin <phy1729@xxxxxxxxx> wrote:
> >
> > I would think ZSH_DEBUG_CMD is local to the trap execution. Otherwise
> > DEBUG traps can "break" warn_create_global clean functions.
> 
> Hm.  Making it implicitly local would change the behavior with respect
> to "unset after the trap."  I don't know how important that is.
> 
> However, it should be possible for it to be set without tripping the
> warning, we just need to call assignsparam() instead of setsparam().

This solves the example provided (and the original issue[1]). I have no
strong opinion on changing the documented behavior, so it should
probably be kept as is.

1: https://github.com/zsh-users/zsh-syntax-highlighting/issues/438



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