Skip to content

Style modified lines from inserted-only lines #325

@richardgill

Description

@richardgill

Summary: add a separate modified-line highlight so changed lines on the right side do not use the same line background as pure insertions.

Suggested API change:

require("codediff").setup({
  highlights = {
    line_insert = "DiffAdd",
    line_change = "DiffChange",
    line_delete = "DiffDelete",
    char_insert = "DiffText",
    char_delete = "DiffDelete",
  },
})

Requirements:

  • Modified lines on the modified side should use a different line highlight from inserted-only lines
  • Pure insertions should keep the insert highlight
  • Modified-side line highlighting should be configurable separately from insert highlighting
  • This should work in both side-by-side and inline rendering

AI disclosure: this issue and linked PR were prepared with AI assistance.
PR: #324

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