From 710f0eae2f5a626a0771acbb1fb32e121bbf2bde Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 1 May 2021 19:29:13 -0400 Subject: vim-patch:1b884a005398 Update runtime files. https://github.com/vim/vim/commit/1b884a0053982335f644eec6c71027706bf3c522 Omit doc/autocmd.txt. Omit tools/emoji_list.vim. Patch v8.2.1540 is not ported. --- runtime/syntax/diff.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/syntax/diff.vim') diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim index b656cd97a6..ac43d6650a 100644 --- a/runtime/syntax/diff.vim +++ b/runtime/syntax/diff.vim @@ -2,7 +2,7 @@ " Language: Diff (context or unified) " Maintainer: Bram Moolenaar " Translations by Jakson Alves de Aquino. -" Last Change: 2016 Apr 02 +" Last Change: 2020 Dec 07 " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") @@ -346,9 +346,11 @@ syn match diffLine "^---$" syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*" syn match diffFile "^diff\>.*" -syn match diffFile "^+++ .*" 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 "^--- .*" -- cgit From c1dd4e83b494d19a5ebcb7ffb936cb4649f11637 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 1 May 2021 21:56:01 -0400 Subject: vim-patch:7e6a515ed14e Update runtime files. https://github.com/vim/vim/commit/7e6a515ed14e204fafb3dd6e98f2fb543e64aedd Omit vim9. --- runtime/syntax/diff.vim | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'runtime/syntax/diff.vim') 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 " 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.*" -- cgit