Skip to content

theme selector saves theme into wrong INI section #148

@rashpile

Description

@rashpile

Bug: theme selector saves theme = ... into wrong INI section

When picking a theme via Shift+T, the selected theme is persisted to ~/.config/revdiff/config. If the config file already has a [color options] section at the end, the new
theme = ... line gets appended to the end of the file — landing inside [color options] instead of [Application Options]. The next run then warns unknown option: theme and
the theme isn't applied.

Repro

  1. Config file with any [color options] section present at the end:
    [Application Options]
    word-diff = true
    compact = true
    
    [color options]
    ;color-word-add-bg = #1a8f00
  2. Open revdiff, press Shift+T, pick a theme, confirm.
  3. Quit and run revdiff --version.

Expected

Config parses cleanly. Theme persists.

Actual

warning: config ~/.config/revdiff/config: ~/.config/revdiff/config:11: unknown option: theme

Resulting file has the theme = ... line inside [color options]:
[color options]
;color-word-add-bg = #1a8f00
theme = nord ← wrong section

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions