Skip to content

Remove override: comment out lines with notes instead of deleting them - #6

Merged
arithex merged 1 commit into
mainfrom
claude/tester-feedback-functional
Oct 29, 2026
Merged

arithex merged 1 commit into
mainfrom
claude/tester-feedback-functional

Conversation

@arithex

@arithex arithex commented Oct 29, 2026

Copy link
Copy Markdown
Owner

This fixes a data-loss bug reported by testers. Remove override deleted the whole set line, so a note the user had written on that line was deleted with it, e.g.

set g_bSomeExperimentalFeature 1 // NOTE: remember to turn this off before multiplayer session

Changes

Remove override (CfgDocument.RemoveValue)

  • If the line has no trailing comment, it is deleted, as before.
  • If it has a trailing comment, it is commented out instead, keeping its indentation and the note:
    // set g_bSomeExperimentalFeature 1 // NOTE: remember to turn this off before multiplayer session
  • As before, User.cfg is only changed above the Launcher cut line.

Apply (CfgDocument.SetValue)

  • If there is no active set line but a commented-out one exists above the cut line, that line is uncommented and only its value is replaced. Remove followed by Apply therefore gives back the original line unchanged.
  • Otherwise it behaves as before: it edits the existing line, or adds a new one above the cut line.

Parsing and the list (CfgDocument.ParseLine, ConfigSet)

  • New line kind CommentedSet: a comment marker (// or #) followed by a valid set statement. It is checked before category headers, so // set g_bFoo 1 // isn't mistaken for a category.
  • Commented-out lines in User.cfg (above the cut line) and in VR.cfg count as known params. A param that isn't in Falcon BMS.cfg therefore stays in the list under Other after it's removed. Commented-out lines in Falcon BMS.cfg itself are ignored, as before.
  • Detail pane: missing values now read "(none)" for Default, Current, User.cfg and VR.cfg, and "(none; commented out)" when a commented-out line exists. The Remove override tooltip now describes the new behaviour.

Testing

  • 51 unit tests pass: the 46 existing ones plus 5 new.
    • Remove deletes a plain line and comments out a line with a note. A line with an empty // comment is deleted.
    • Apply uncomments // and # lines above the cut line, and leaves commented lines below it alone.
    • Remove followed by Apply gives back the original line exactly.
    • // set ... // is parsed as a commented-out param, not a category.
    • Commented-out params appear in the list: under their own category when they're in Falcon BMS.cfg, under Other when they aren't. Lines in Falcon BMS.cfg and below the cut line are ignored.
  • The C# compiles against the .NET 4.8 reference assemblies, using stand-ins for the code the XAML generates.
  • Windows CI build.
  • Manual check on a real User.cfg.

Generated by Claude Code

Per tester feedback, deleting a set line also deleted the user's trailing
comment (eg. a note to self). Now:
- Remove override deletes a set line only if it has no trailing comment;
  otherwise it comments the line out ("// set ..."), keeping the note.
- Applying a value with no active set line, but a commented-out one above
  the cut line, uncomments that line and updates its value.
- Commented-out set lines in User.cfg / VR.cfg are listed as params, so a
  param not in Falcon BMS.cfg doesn't vanish from the list once removed.
  The detail pane shows "(none)" for missing values, and notes when a
  commented-out line exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KaEsnLMDyw72GZ8a6ZxAGq
@arithex
arithex merged commit ce13779 into main Oct 29, 2026
2 checks passed
@arithex
arithex deleted the claude/tester-feedback-functional branch October 30, 2026 02:04
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