runtime(jj): Support diffs in jj syntax

Commit: 
https://github.com/vim/vim/commit/bde76da4d02d93d8ea9e523d1057d59a19de276a
Author: Gregory Anders <g...@gpanders.com>
Date:   Fri Jan 3 10:34:24 2025 +0100

    runtime(jj): Support diffs in jj syntax
    
    related: https://github.com/vim/vim/issues/16364
    
    Signed-off-by: Gregory Anders <g...@gpanders.com>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/syntax/jj.vim b/runtime/syntax/jj.vim
index a2911a026..0b2d29e87 100644
--- a/runtime/syntax/jj.vim
+++ b/runtime/syntax/jj.vim
@@ -6,7 +6,6 @@
 if exists('b:current_syntax')
   finish
 endif
-let b:current_syntax = 'jj'
 
 syn match jjAdded "A .*" contained
 syn match jjRemoved "D .*" contained
@@ -14,7 +13,12 @@ syn match jjChanged "M .*" contained
 
 syn region jjComment start="^JJ: " end="$" contains=jjAdded,jjRemoved,jjChanged
 
+syn include @jjCommitDiff syntax/diff.vim
+syn region jjCommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ 
end=/^\%(diff --\|$\|@@\@!\|[^[:alnum:]\ +-]\S\@!\)\@=/ fold 
contains=@jjCommitDiff
+
 hi def link jjComment Comment
 hi def link jjAdded Added
 hi def link jjRemoved Removed
 hi def link jjChanged Changed
+
+let b:current_syntax = 'jj'

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tTeEp-004cBv-0R%40256bit.org.

Raspunde prin e-mail lui