fix(shell): retain prefix during up-arrow history search - #3
Merged
Conversation
|
fast-syntax-highlighting rewrites $LASTWIDGET, causing up-line-or-beginning-search to lose the original prefix on consecutive invocations. Replace it with a custom wrapper around the builtin .history-beginning-search-backward that: - tracks continuation via $BUFFER comparison instead of $LASTWIDGET - moves cursor to end-of-line after each match - clears stale POSTDISPLAY left by zsh-autosuggestions
- extract common steps into reusable composite actions - create setup-bench-env action for Nix install and environment setup - create run-benchmark action for hyperfine execution - add benchmark-pr.yml to run benchmarks on pull requests - refactor benchmark.yml to use composite actions - remove redundant zsh warmup (hyperfine --warmup handles it)
- benchmark-action internally commits to gh-pages even with save-data-file: false, causing failure due to missing 1Password SSH signer in CI
There was a problem hiding this comment.
Zsh Startup Time
Details
| Benchmark suite | Current: 336d950 | Previous: 4dd7144 | Ratio |
|---|---|---|---|
zsh -i -c exit |
53.81 ms (18.06 ms) |
44.69 ms (16.13 ms) |
1.20 |
This comment was automatically generated by workflow using github-action-benchmark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
fixes #2
Changes
up-line-or-beginning-searchwith custom wrapper around.history-beginning-search-backward$BUFFERcomparison instead of$LASTWIDGET(which gets rewritten byfast-syntax-highlighting)POSTDISPLAYleft byzsh-autosuggestions(widget name starts with_so it's not wrapped by autosuggestions)Verification
Additional Notes
The root cause was
fast-syntax-highlightingwrapping the widget, which rewrites$LASTWIDGETand breaks the consecutive-call detection mechanism inup-line-or-beginning-search.