Repository navigation
Let the changed-word highlight be a background, an underline or off - #31
Merged
Merged
Conversation
The word marks inside a paired remove/add line were always a filled orange background. A new word_highlight setting (background, underline, off) picks how they look. It is a segmented control under "Changed words" in Settings and a "Cycle changed-word highlight" palette command. The marks now carry class="word-hl", so the styling no longer touches the plain <mark> the search dialog uses, and they drop the 1px side padding the generic mark rule adds, which pushed the rest of a marked line off the columns of the other side. Bump version to 0.12.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ
bwets
marked this pull request as draft
November 20, 2026 13:59
bwets
added a commit
to bwets/diffui
that referenced
this pull request
Nov 20, 2026
The end-to-end test looked for a bare <mark>old</mark>. Matching on ">old</mark>" still proves the mark starts on the changed word, and keeps passing if the mark gains a class, as dgsienko#31 does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ
bwets
marked this pull request as ready for review
November 20, 2026 14:06
This was referenced Nov 20, 2026
…-style # Conflicts: # AGENTS.md # pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A setting for how changed words inside a modified line are shown:
It sits under "Changed words" in Settings (a segmented control, like the diff mode switch) and in the command palette as "Cycle changed-word highlight". It is saved in
settings.jsonasword_highlight.How
SettingsUpdate.word_highlightacceptsbackground,underlineoroff, andAppStateloads and saves it likeword_wrap._apply_word_highlightsemits<mark class="word-hl">, so the new rules leave the plain<mark>of the search dialog alone.useAppearanceputsword-hl-background,word-hl-underlineorword-hl-offon<html>, andstyle.cssstylesmark.word-hlfrom it. No new colors: the underline usescurrentColor.mark.word-hlhas no side padding. The genericmarkrule adds0 1px, which shifted the rest of a marked line by 2px per mark against the other side of the split view.Tests
test_settings_roundtripcoversword_highlightset tounderlineand tooff._apply_word_highlightscases expect theword-hlclass.pytest(319 passed),ruff checkandruff format --checkare clean. Checked by hand in the web UI: each option restyles the open diff at once and survives a reload.Version bumped to 0.12.0. This is independent of #30, which bumps to 0.11.3, so whichever merges second only needs the version line resolved.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xshwvphn2wQmVKLLS2G9kJ