vim-git icon indicating copy to clipboard operation
vim-git copied to clipboard

git word diff syntax highlighting breaks on empty line

Open step- opened this issue 2 years ago • 0 comments

The syntax file for filetype=git includes syntax patterns for git word diff mode (git --diff --word-diff). However, if the first line after the diffLine @@ is empty the patterns fail to match and the whole diff block isn't highlighted anymore.

Example (set filetype=git):

@@ -124,7 +124,7 @@ typedef enum {
	BLOCK_NONE,
	BLOCK_STD,
	BLOCK_START
	BLOCK_[-DELETE-]{+ADD+},
	BLOCK_END,
} Mode;

Above @@ -124... is highlighted with diffLine, typedef enum { with diffSubname, [-DELETE-] with gitDiffRemoved and {+ADD+} with gitDiffAdded. If I insert a line after @@ -124... the block of lines after @@ -124... stops being highlighted.

step- avatar Sep 30 '23 19:09 step-