* Upcoming zle-line-pre-redraw hook – can it be saved and restored?
@ 2016-10-28 8:18 Sebastian Gniazdowski
2016-10-28 14:13 ` Daniel Shahaf
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2016-10-28 8:18 UTC (permalink / raw)
To: zsh-workers
Hello
There is the zle-line-pre-redraw hook upcoming that will be used by
zsh-syntax-highlighting. I wonder if it will be possible to save,
disable and then restore the hook?
The point is, I want to have clear environment in recursive-edit. It's
now fully possible, defining own keymap, restoring original widgets to
specific keys, overloading self-insert with .self-insert, calling
recursive-edit with `-K ownkeymap`. This way interference from the two
popular code-injecting plugins – zsh-autosuggestions and
zsh-syntax-highlighting – can be inhibited.
With zle-line-pre-redraw, one will have to also save the hook, disable
it, then restore it after leaving recursive-edit. Will this be
possible?
PS. This can also be needed for vared. Currently z-sy-h tries to
colorify what user enters, what has rather bad effects, as things are
basically drawn in red.
--
Sebastian Gniazdowski
psprint@fastmail.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Upcoming zle-line-pre-redraw hook – can it be saved and restored?
2016-10-28 8:18 Upcoming zle-line-pre-redraw hook – can it be saved and restored? Sebastian Gniazdowski
@ 2016-10-28 14:13 ` Daniel Shahaf
2016-10-28 15:00 ` Upcoming zle-line-pre-redraw hook - " Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Shahaf @ 2016-10-28 14:13 UTC (permalink / raw)
To: Sebastian Gniazdowski; +Cc: zsh-workers
Sebastian Gniazdowski wrote on Fri, Oct 28, 2016 at 01:18:58 -0700:
> With zle-line-pre-redraw, one will have to also save the hook, disable
> it, then restore it after leaving recursive-edit. Will this be
> possible?
>
You could delete the 'zle-line-pre-redraw' widget at entry and re-create
it at exit. Or do the same with the function it is bound to (and
replace it by an empty(){} stub to avoid stderr spam).
> PS. This can also be needed for vared. Currently z-sy-h tries to
> colorify what user enters, what has rather bad effects, as things are
> basically drawn in red.
I fixed that months ago. You should merge from or rebase on top of the
latest z-sy-h master.
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Upcoming zle-line-pre-redraw hook - can it be saved and restored?
2016-10-28 14:13 ` Daniel Shahaf
@ 2016-10-28 15:00 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2016-10-28 15:00 UTC (permalink / raw)
To: zsh-workers
On Oct 28, 2:13pm, Daniel Shahaf wrote:
}
} Sebastian Gniazdowski wrote on Fri, Oct 28, 2016 at 01:18:58 -0700:
} > With zle-line-pre-redraw, one will have to also save the hook, disable
} > it, then restore it after leaving recursive-edit. Will this be
} > possible?
} >
}
} You could delete the 'zle-line-pre-redraw' widget at entry and re-create
} it at exit. Or do the same with the function it is bound to (and
} replace it by an empty(){} stub to avoid stderr spam).
Hmm.
add-zle-hook-widget could arrange to have the hook functions examine a
"disabled" zstyle and skip the entire list, or perhaps skip selected
widgets ... but what would the context be? Something to do with the
function call stack?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-10-28 17:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 8:18 Upcoming zle-line-pre-redraw hook – can it be saved and restored? Sebastian Gniazdowski
2016-10-28 14:13 ` Daniel Shahaf
2016-10-28 15:00 ` Upcoming zle-line-pre-redraw hook - " Bart Schaefer
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).