summaryrefslogtreecommitdiffstats
path: root/syntax/diff.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2021-01-03 14:09:55 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2021-01-03 14:09:55 +0100
commit09f31c433a136450b9faa33b08fc3281bdea5acc (patch)
tree73a1db640af5c34c55bed51916ea8cf821e7dad2 /syntax/diff.vim
parent05b8bbc938bdeac4a5ee2d3ae5cf7a7f05e822d3 (diff)
downloadvim-polyglot-09f31c433a136450b9faa33b08fc3281bdea5acc.tar.gz
vim-polyglot-09f31c433a136450b9faa33b08fc3281bdea5acc.zip
Revert stylus provider
Diffstat (limited to '')
-rw-r--r--syntax/diff.vim17
1 files changed, 11 insertions, 6 deletions
diff --git a/syntax/diff.vim b/syntax/diff.vim
index 6e1306dc..e897a917 100644
--- a/syntax/diff.vim
+++ b/syntax/diff.vim
@@ -6,7 +6,7 @@ endif
" Language: Diff (context or unified)
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Translations by Jakson Alves de Aquino.
-" Last Change: 2020 Dec 07
+" Last Change: 2020 Dec 30
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -352,11 +352,16 @@ syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*"
syn match diffFile "^diff\>.*"
syn match diffFile "^Index: .*"
syn match diffFile "^==== .*"
-" Old style diff uses *** for old and --- for new.
-" Unified diff uses --- for old and +++ for new; names are wrong but it works.
-syn match diffOldFile "^+++ .*"
-syn match diffOldFile "^\*\*\* .*"
-syn match diffNewFile "^--- .*"
+
+if search('^@@ -\S\+ +\S\+ @@', 'nw', '', 100)
+ " unified
+ syn match diffOldFile "^--- .*"
+ syn match diffNewFile "^+++ .*"
+else
+ " context / old style
+ syn match diffOldFile "^\*\*\* .*"
+ syn match diffNewFile "^--- .*"
+endif
" Used by git
syn match diffIndexLine "^index \x\x\x\x.*"