Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#83 better highlighting for unified diffs

closed
nobody
Feature (36)
5
2008-10-26
2007-04-11
Dirk_S.
No

While fiddling with different versions of the ftype file, I got struck be the fact that the existing diff.jsf lost track whenever it hit 2 minuses in a row at the beginning of a line within a hunk. I found this very annoying, so I started to write "udiff.jsf". It only handles unified diffs, so the "diff.jsf" is still needed for everything else.

It does more careful handling of "-" chars and only looses track if it hits three "-" in a row followed by a blank followed by a non-blank at the beginning of a line within a hunk. It can also deal (to some extend) with leading garbage before a hunk, but in this case you'll most likely need to specify syntax "udiff" explicitly.

It's still not perfect but it is (IMHO) a bit better than the one of vim. :P

Discussion

  • Dirk_S.
    Dirk_S.
    2007-04-11

    Syntax highlighting for unified diffs

     
    Attachments
  • Dirk_S.
    Dirk_S.
    2007-04-11

    excerpt from my ftyperc - auto-recognize udiff files

     
    Attachments
  • Dirk_S.
    Dirk_S.
    2007-04-11

    Logged In: YES
    user_id=1448128
    Originator: YES

    Please see the "ftyperc.snippet" about how to automatically recognise files that contain unified diffs or patches.

    File Added: ftyperc.snippet

     
  • Joe Allen
    Joe Allen
    2008-10-26

    I've taken your newer _diff.jsf, so I'm closing this one.

     
  • Joe Allen
    Joe Allen
    2008-10-26

    • status: open --> closed