feat: add word_del_strikethrough config option - #2
Open
leolaurindo wants to merge 1 commit into
Open
Conversation
Allow disabling the strikethrough on deleted words within changed lines. Defaults to true, preserving current behavior.
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.
Allow disabling the strikethrough on deleted words within changed
lines. Defaults to true, preserving current behavior.
Summary
Add a configuration option for the strikethrough applied to deleted words inside changed lines.
The default remains
true, preserving current behavior.Motivation
The plugin currently uses two different visual treatments:
InlineDiffDeletebackground.InlineDiffWordDel, which also enablesstrikethrough.The strikethrough is useful for some users, but in my honest opinion it can be visually noisy, especially when the deleted virtual line already has a deletion background. This option lets users choose the latter style without overriding highlight groups manually.
Usage
The default still is
word_del_strikethrough = true, so the behavior on existing configs remain unchanged.Implementation
The option is applied when highlights are defined and re-applied when the plugin is enabled. This ensures the setting survives:
Testing
Added tests covering:
Full test suite passes:
Success: 23
Failed: 0
Errors: 0
The combined demo branch is available at:
https://github.com/leolaurindo/inline-diff.nvim/tree/dev/all