zsh-workers
 help / color / mirror / code / Atom feed
* Bug: Callback to widget set with `zle -Fw <widget>` shouldn't change $LASTWIDGET
@ 2022-11-16 15:06 Marlon Richert
  2022-11-16 18:24 ` Bart Schaefer
  2023-01-17  0:01 ` [PATCH] " Bart Schaefer
  0 siblings, 2 replies; 17+ messages in thread
From: Marlon Richert @ 2022-11-16 15:06 UTC (permalink / raw)
  To: Zsh hackers list

Currently, when the ZLE calls a widget set with `zle -Fw <widget>`,
this changes the value of $LASTWIDGET. This in turn breaks several of
the widgets listed in the manual under User Contributions. For
example:

% zsh -f
% autoload -Uz copy-earlier-word
% zle -N copy-earlier-word
% bindkey '\e,' copy-earlier-word
% # Pressing ^[, multiple times at this point successfully cycles
through the current words on the command line.
% handler() { local fd=$1; zle -F $fd; exec {fd}<&- }
% zle-line-pre-redraw() { local fd; exec {fd}< <( print ); zle -Fw $fd handler }
% zle -N handler
% zle -N zle-line-pre-redraw
% # Now ^[, still copies the last word on the line, but can no longer
cycle to previous words when pressed again.


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-07-20  4:26 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 15:06 Bug: Callback to widget set with `zle -Fw <widget>` shouldn't change $LASTWIDGET Marlon Richert
2022-11-16 18:24 ` Bart Schaefer
2022-11-17 13:04   ` Marlon Richert
2022-11-17 13:28     ` Roman Perepelitsa
2022-11-17 16:18     ` Bart Schaefer
2023-01-11  7:45       ` Marlon Richert
2023-01-17  0:01 ` [PATCH] " Bart Schaefer
2023-01-17  9:22   ` Peter Stephenson
2023-01-17 18:00     ` Bart Schaefer
2023-07-16 10:28       ` dana
2023-07-17  8:42         ` Peter Stephenson
2023-07-17 15:17         ` Bart Schaefer
2023-07-17 15:52           ` dana
2023-07-17 15:57             ` Bart Schaefer
2023-07-17 16:57               ` Bart Schaefer
2023-07-20  4:01                 ` dana
2023-07-20  4:25                   ` 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).