feat(explorer): Add auto_open_on_cursor and auto_open_debounce_ms options#400
Open
craftzdog wants to merge 1 commit into
Open
feat(explorer): Add auto_open_on_cursor and auto_open_debounce_ms options#400craftzdog wants to merge 1 commit into
auto_open_on_cursor and auto_open_debounce_ms options#400craftzdog wants to merge 1 commit into
Conversation
… options Auto-open diff for the node under cursor while moving (j/k) in the explorer. Debounced so fast traversal doesn't spam diff loads; the duplicate-file guards inside on_file_select handle the cases where the cursor lands back on the already-open file (e.g. after navigate_next).
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.
Hi! I love this plugin for my agentic workflow. I wanted to add a feature that allows you to automatically open the diff for the file under the cursor so that I can review files more quickly.
Summary
Adds an opt-in mode that auto-opens the diff for the file under the cursor as you move through the explorer with
j/k, so you can browse changes without pressing Enter on each file.Changes
auto_open_on_cursor(defaultfalse) — when enabled, moving the cursor in the explorer opens the diff for the node beneath it.auto_open_debounce_ms(default80) — debounce window so fastj/ktraversal doesn't spam diff loads.The
CursorMovedhandler is debounced and skips group/directory nodes and the already-open file. Its timer is cleaned up onBufWipeout.Config
Test plan
tests/ui/explorer/explorer_spec.luacover the debounce behavior, node-type skipping, and duplicate-file guards.