zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] add-zle-hook-widget zle-line-pre-redraw issue
Date: Sat, 23 Jul 2016 18:14:45 -0700	[thread overview]
Message-ID: <160723181445.ZM20105@torch.brasslantern.com> (raw)
In-Reply-To: <20160723212335.GA20872@tarsus.local2>

On Jul 23,  9:23pm, Daniel Shahaf wrote:
}
} The reason appears to be that, while in azhw:zle-line-init $WIDGET is
} "zle-line-init", in azhw:zle-line-pre-redraw $WIDGET is the name of the
} widget the user invoked (e.g., "self-insert"), so the 'zstyle -a' does
} not find the registered hooks.

If zsh-syntax-highlighting doesn't depend on that behavior, it's probably
unlikely that anything else does.

However, Mikael will have to weigh in on whether he chose do to this
intentionally.

} Each of the following alternative patches solves the issue:

The "second option" obviously isn't finished / leaves a lot of dead
code behind.  However, I think the first option is the correct one,
unless there's a good reason to leave $WIDGET alone; the context
that's being saved/restored by redrawhook() is important, because
we're in the middle of an arbitrary other widget

This is actually related to what I was saying about it not being
appropriate to stick a list of callbacks on any widget.

We can easily special-case add-zle-hook-widget to find the name another
way for this particular hook.  $funcstack[1] for example.

Incidentally, I tried making ALL the possible hooks be

    zle -M "$WIDGET $funcstack[1]"

and learned two things.  (1) pre-redraw is in fact the only hook that
doesn't change $WIDGET, and (2) having all the hooks call "zle -M"
garbles the output quite thoroughly, especially in vi mode.


  reply	other threads:[~2016-07-24  4:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 21:23 Daniel Shahaf
2016-07-24  1:14 ` Bart Schaefer [this message]
2016-07-24 21:30   ` Daniel Shahaf
2016-07-28  2:34     ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=160723181445.ZM20105@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).