Skip to content

Add ignoreCase and ignoreWhitespace options - #26

Merged
krkarma777 merged 1 commit into
masterfrom
feature/ignore-options
Aug 31, 2026
Merged

Add ignoreCase and ignoreWhitespace options#26
krkarma777 merged 1 commit into
masterfrom
feature/ignore-options

Conversation

@krkarma777

Copy link
Copy Markdown
Owner

Closes #16

Summary

  • `ignoreCase`: tokens compare case-insensitively (all modes, including char via the generic token pipeline)
  • `ignoreWhitespace`: whitespace runs compare equal; `line` mode compares trimmed lines (diffTrimmedLines-style); whitespace with no counterpart still diffs as insert/delete
  • Both implemented as an interning-layer normalizer — the Myers core is untouched; the fast scanner paths still serve the default (no-options) case
  • Semantics documented: with an ignore option active, `equal` texts come from `b`, so non-delete concatenation reproduces `b` exactly (a single equal text cannot be both `Fox` and `fox`)
  • `diffTokens` accepts both options for custom tokens; `refine` sub-diffs inherit them

Test Plan

  • 8 new tests incl. 1,800-case fuzz asserting the b-side reconstruction invariant across word/char/line x option combinations
  • One test expectation was corrected during development (word-mode tokens don't split `ab`), caught by running the suite — the library behavior was right
  • Full suite 58/58, typecheck clean

@krkarma777
krkarma777 merged commit 0f41c01 into master Aug 31, 2026
5 checks passed
@krkarma777
krkarma777 deleted the feature/ignore-options branch August 31, 2026 02:27
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.

feat: ignoreCase / ignoreWhitespace options

1 participant