claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Inconsistent Syntax Highlighting on Wrapped Lines in Diff View

Open Cheffromspace opened this issue 6 months ago • 0 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
  • Claude CLI version: 1.0.6 (Claude Code)
  • Operating System: Windows 11/Ubuntu 22.04
  • Terminal: Windows Terminal
  • Verbose output: false
  • Theme: Dark mode (colorblind-friendly)

Description

When viewing diffs with long lines that wrap in the terminal, the syntax highlighting/coloring is not applied consistently across the wrapped portion of the line. Only the first part of the wrapped line displays the expected background color, while the continuation on the next line reverts to the default background.

Expected Behavior

The entire logical line, including wrapped portions, should maintain consistent background coloring to clearly indicate additions/deletions in the diff.

Actual Behavior

  • First part of the line: Displays correct background color (red for deletions, green for additions)
  • Wrapped continuation: Loses background coloring, making it unclear that it's part of the same added/deleted line

Steps to Reproduce

  1. View a diff containing lines longer than the terminal width
  2. Observe lines that wrap to the next line
  3. Note the inconsistent background coloring between the first part and wrapped portion

Visual Example

In the provided screenshot:

  • Line 141: The red background (deletion) only applies to the first part
  • Line 142: The green background (addition) only applies to the first part
  • The wrapped portions appear with default background color

Impact

This makes it difficult to quickly scan diffs and identify which parts belong to added vs deleted lines, especially with long lines containing URLs or documentation.

Suggested Fix

Ensure that wrapped line continuations inherit the same background color/styling as their parent line in diff views.

Environment

[Add your environment details here - OS, terminal, diff tool being used]

Image

Cheffromspace avatar Jun 01 '25 18:06 Cheffromspace