Skip to content

feat(status): add keybind for full diff view from status menu, fix reload with recent fzf versions#70

Open
iloveitaly wants to merge 1 commit intobigH:mainfrom
iloveitaly:fix-recent-fzf
Open

feat(status): add keybind for full diff view from status menu, fix reload with recent fzf versions#70
iloveitaly wants to merge 1 commit intobigH:mainfrom
iloveitaly:fix-recent-fzf

Conversation

@iloveitaly
Copy link
Contributor

Adds inspect (Alt-I) key to open a file's diff in pager from status menu.

More important change is the reload functionality is now fixed with recent fzf versions. Was working 0.66 for me and broke on 0.70. Here's the AI research on what changed.


fzf 0.70 changed async reload behavior

fzf 0.70 introduced significant internal performance improvements (1.3–1.9x faster filtering/rendering). As a side effect, the async reload: action now resets cursor position when the new list arrives — it no longer preserves the numeric cursor offset that was set by a preceding down action.

The old action chain was:

execute-silent(cmd) + down + reload:cmd

This relied on down running first, then reload: arriving asynchronously while fzf preserved the cursor position. In fzf 0.70, the async reload overtakes/resets the position.

The fix: reload-sync

reload-sync (available since fzf 0.36.0) performs a synchronous reload — fzf blocks until the new list is fully loaded before executing subsequent actions. Reordering to:

execute-silent(cmd) + reload-sync(cmd) + down

means down runs against the already-settled, final list. No race condition, no position reset.

--track is not a viable alternative here because the status prefix changes on staging ( MM ), so fzf can't match the item identity across the reload.

The synchronous block is imperceptible in practice since git status -s completes in sub-millisecond time for typical repos.

…load with recent fzf versions

- Adds inspect (Alt-I) key to open a file's diff in pager from status menu.
- Binds new inspect key and displays hint in header.
- Implements helper to show diff, including for directories and renamed files.

Generated-by: aiautocommit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant