Skip to content

Diff: Add inline (intra-line) change highlighting #16

Description

@vipmax

Problem

The current diff view highlights only whole added/removed lines.
This makes it hard to quickly understand what changed inside a modified line.

Current behavior

Whole lines are colored, but changed fragments inside a line are not:

Current behavior

Expected behavior

In modified lines, changed fragments should be highlighted inline (word/segment level), similar to GitHub-style diffs:

  • removed fragments with a red inline background,
  • added fragments with a green inline background.

Expected behavior

Scope

Add inline change highlighting for modified lines while keeping existing line-level highlighting.

Acceptance Criteria

  • Inline highlighting is shown for modified lines (not only whole-line add/remove background).
  • Highlighting works correctly for TypeScript code and does not break current syntax highlighting.
  • No noticeable performance regression on large diffs.
  • Tests are added/updated for diff rendering logic (where applicable).

Implementation Notes

A word/token-level diff algorithm can be used (for example, diff-match-patch or equivalent), then rendered as inline spans on top of existing diff markup.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions