Skip to content

refactor(tui): simplify span merging and node ref helpers - #40

Merged
HarshK97 merged 1 commit into
mainfrom
refactor/tui-highlight-simplification
Aug 1, 2026
Merged

refactor(tui): simplify span merging and node ref helpers#40
HarshK97 merged 1 commit into
mainfrom
refactor/tui-highlight-simplification

Conversation

@HarshK97

@HarshK97 HarshK97 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Problem

  1. Line highlight merging checked exact parent equality when deciding whether to join nearby edit spans. Child nodes under parent subtrees were treated as separate spans, causing fragmented highlight chips on screen.
  2. Helper functions used manual loops and verbose switch statements for slice prefix comparison and operator checks.

What Changed

  • TUI Highlight Merging: Added ancestor lineage checking so updates and moves within the same AST subtree merge into clean continuous highlight spans. Tightened maximum gap threshold from 5 to 3 columns.
  • Node Ref Helpers: Replaced manual slice prefix and equality loops with Go standard library slices.Equal.
  • Character Matching: Simplified operator character checks using bytes.ContainsAny.

@HarshK97
HarshK97 merged commit 991a6b5 into main Aug 1, 2026
6 checks passed
@HarshK97
HarshK97 deleted the refactor/tui-highlight-simplification branch August 1, 2026 13:32
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.

1 participant