Skip to content

feat(config): add show_file_list, diff_view, and wrap config options#218

Merged
agavra merged 1 commit intoagavra:mainfrom
martintrojer:feat/config-options
Mar 19, 2026
Merged

feat(config): add show_file_list, diff_view, and wrap config options#218
agavra merged 1 commit intoagavra:mainfrom
martintrojer:feat/config-options

Conversation

@martintrojer
Copy link
Copy Markdown
Collaborator

Add three new config keys to ~/.config/tuicr/config.toml:

  • show_file_list (bool): hide the file list panel on startup (default: true). Toggleable at runtime with ;e.
  • diff_view ("unified" | "side-by-side"): set the default diff layout (default: "unified"). Toggleable at runtime with :diff.
  • wrap (bool): enable line wrapping in the diff view (default: false). Toggleable at runtime with :set wrap!.

Refactor config parsing to use read_string/read_bool/read_enum helpers, reducing repetition. Extract parse_optional_nonempty_string for comment_types field parsing. Replace inline known-key list with a KNOWN_KEYS constant. Simplify tests with a parse_config helper.

Add three new config keys to ~/.config/tuicr/config.toml:

- show_file_list (bool): hide the file list panel on startup (default:
  true). Toggleable at runtime with ;e.
- diff_view ("unified" | "side-by-side"): set the default diff layout
  (default: "unified"). Toggleable at runtime with :diff.
- wrap (bool): enable line wrapping in the diff view (default: false).
  Toggleable at runtime with :set wrap!.

Refactor config parsing to use read_string/read_bool/read_enum helpers,
reducing repetition. Extract parse_optional_nonempty_string for
comment_types field parsing. Replace inline known-key list with a
KNOWN_KEYS constant. Simplify tests with a parse_config helper.
Copy link
Copy Markdown
Owner

@agavra agavra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should probably consider using a dedicated config crate at some point but we can do that in a follow up

@agavra agavra merged commit d74d413 into agavra:main Mar 19, 2026
4 checks passed
@martintrojer martintrojer deleted the feat/config-options branch March 25, 2026 08:48
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.

2 participants