Repository navigation
feat: changed_only config key to start on the changed-only tree - #196
Merged
Merged
Conversation
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.
Closes #195
What
New config key
changed_only = true|false(defaultfalse). Whentruethe viewer starts as ifchad already been pressed: the changed-only tree against the active baseline.cstill toggles back to the full tree.Config.changed_only→EffectiveSettings.changed_only(config > default, no env var).Controller::apply_changed_onlyreuses thectoggle, so it is a no-op outside a git repo (full tree, no notice), clears nothing it shouldn't, and re-renders for the filtered selection. Wired inapp::runbefore the launch open target, next toexpand_changed.c: refresh /bre-filter,dreplaces it, a worktree switch carries the currentcstate (it does not re-read the key).Docs
docs/configuration.md(precedence list, example block, prose),docs/usage.md(git-awareness),config.example.toml,?Settings row,CHANGELOG.md, and both key lists intests/docs_consistency.rs.Tests
config.rs:changed_only_resolves_config_over_default.tests/controller.rs: starts on the changed-only tree (only the changed file visible, cursor off the clean file, render dispatched, survives a refresh, idempotent);ctoggles back;falseleaves the full tree with no re-render; non-git root ignores it.help.rsSettings row lists.cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test,cargo auditall green locally (macOS).Real-binary proof
Release build, throwaway repo on branch
featwithsrc/util.rsmodified anddocs/new.mduntracked,HERDR_PLUGIN_CONFIG_DIRpointing at achanged_only = trueconfig. First frame:c→ full tree (docs,src,Cargo.toml,README.md);cagain → back to changed-only. Same repo without the key starts on the full tree. A non-git dir with the key on shows the full tree.