aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/diff.vim
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-01 21:56:01 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-01 22:29:03 -0400
commitc1dd4e83b494d19a5ebcb7ffb936cb4649f11637 (patch)
treecf945ae6c174d372c74497efa8baee2e7aeabc7f /runtime/syntax/diff.vim
parentb1cd67b62e58c7f7d4139416e6813f8f50bc0fd6 (diff)
downloadrneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.tar.gz
rneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.tar.bz2
rneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.zip
vim-patch:7e6a515ed14e
Update runtime files. https://github.com/vim/vim/commit/7e6a515ed14e204fafb3dd6e98f2fb543e64aedd Omit vim9.
Diffstat (limited to 'runtime/syntax/diff.vim')
-rw-r--r--runtime/syntax/diff.vim17
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
index ac43d6650a..408556ac13 100644
--- a/runtime/syntax/diff.vim
+++ b/runtime/syntax/diff.vim
@@ -2,7 +2,7 @@
" 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")
@@ -348,11 +348,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.*"