On Sun, Dec 6, 2020 at 11:51 AM Bram Moolenaar <[email protected]> wrote:
>
>
> Felipe Contreras wrote:
>
> > Nowadays most people use the unified diff, which has this format:
> >
> > --- a/foo
> > +++ b/foo
> >
> > In that case the old file starts with '---', but currently that's
> > considered the new file, since the old context format is like:
> >
> > *** a/foo
> > --- b/foo
> >
> > Let's use the modern format by default, and leave the option for users
> > to use the old format with `diff_context = 1`.
> >
> > Signed-off-by: Felipe Contreras <[email protected]>
> > ---
> > runtime/syntax/diff.vim | 10 +++++++---
> > 1 file changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/runtime/syntax/diff.vim b/runtime/syntax/diff.vim
> > index b656cd97a..b9e5131e0 100644
> > --- a/runtime/syntax/diff.vim
> > +++ b/runtime/syntax/diff.vim
> > @@ -346,11 +346,15 @@ syn match diffLine "^---$"
> > syn match diffLine "^\d\+\(,\d\+\)\=[cda]\d\+\>.*"
> >
> > syn match diffFile "^diff\>.*"
> > -syn match diffFile "^+++ .*"
> > syn match diffFile "^Index: .*"
> > syn match diffFile "^==== .*"
> > -syn match diffOldFile "^\*\*\* .*"
> > -syn match diffNewFile "^--- .*"
> > +if !exists("diff_context")
> > + syn match diffOldFile "^--- .*"
> > + syn match diffNewFile "^+++ .*"
> > +else
> > + syn match diffOldFile "^\*\*\* .*"
> > + syn match diffNewFile "^--- .*"
> > +end
> >
> > " Used by git
> > syn match diffIndexLine "^index \x\x\x\x.*"
>
> I do not see a reason to omit highlighting +++, in a context diff you
> would not find them.
There's no reason to omit them.
> Your patch makes the name more accurate, but at the same time makes it
> more complicated. If you don't mind the name for the highlight group,
> it just works already.
But it doesn't work. I want to distinguish the file ("^diff\>.*" aka
diffFile) from the new file ("^+++ .*" aka diffNewFile).
So in my colorscheme I have diffNewFile: 'green', diffOldFile: 'red',
diffFile: 'blue' reversed.
https://snipboard.io/BsmkiT.jpg
How do you propose I distinguish diffFile from diffNewFile without my patch?
Cheers.
--
Felipe Contreras
--
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAMP44s24OMzv2MfUVszBiHzDij6kWBKo7CzV2h%3DWyG8YK4pSdQ%40mail.gmail.com.