Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many builtin widgets are being rebound #137

Closed
majutsushi opened this issue Mar 11, 2014 · 3 comments
Closed

Too many builtin widgets are being rebound #137

majutsushi opened this issue Mar 11, 2014 · 3 comments
Labels

Comments

@majutsushi
Copy link

After me tracking down a problem with history-incremental-pattern-search-backward to zsh-syntax-highlighting needlessly rebinding the set-local-history widget, Bart Schaefer listed some more builtin widgets that should get excluded from rebinding or treated specially to avoid potential other issues:

http://www.zsh.org/mla/users/2014/msg00308.html

@nicoulaj nicoulaj added the Bug label Sep 24, 2014
jimmijj added a commit to jimmijj/zsh-syntax-highlighting that referenced this issue Sep 29, 2014
@danielshahaf
Copy link
Member

The problem goes away if s/zle set-local-history/zle .set-local-history/ is applied to the reproduction recipe. This part — a builtin widget that cannot be transparently wrapped — is similar to #150 (comment). That said, fixing set-local-history would be an upstream bug, and we can certainly stop wrapping it in the meantime with no ill effect.

List of widgets from Bart's mail (users/18571):

  • the suffix widgets (auto-*)
  • the argument widgets (*-argument|argument-base)
  • reset-prompt
  • split-undo
  • and probably describe-key-briefly and what-cursor-position,
  • plus set-local-history

Action items for this issue: check which widgets in the above list should be excluded from wrapping; check if any other widgets need to be excluded; follow up with upstream about set-local-history not being transparently wrappable.

danielshahaf added a commit that referenced this issue Sep 25, 2015
See issue #137.  A reproduction recipe for testing this change:

$ zsh -f
% bindkey -e
% source <the script from http://www.zsh.org/mla/users/2014/msg00321.html users/18584>
% source zsh-syntax-highlighting.zsh
% echo foo
% echo bar
% <^R>echo<^R>

This finds the 'echo foo' with this change but not without it.
@danielshahaf
Copy link
Member

Disabled wrapping of set-local-history in cb5589d.

@danielshahaf
Copy link
Member

There doesn't seem to be any downside to wrapping the other widgets Bart mentioned. Wrapping split-undo does mean that calling split-undo in the middle of a longer widget will update highlighting in the middle of the widget (but possibly not at the end of the widget), for example:

f() { BUFFER+=\"; zle split-undo; BUFFER+=42\"\ ; CURSOR=$#BUFFER  } ; zle -N f; bindkey ^T f

will highlight the first " but not the following 42" (until something refreshes the highlight).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants