Skip to content

Support other diff output formats #19

@Nindaleth

Description

@Nindaleth

It seems only one of the diff tool output styles is supported at the moment (diff -u), others are highlighted partially or not at all. I would like for the support to be a bit more complete.

Steps to reproduce:

  1. Create sample files to diff:
# cat 1
hello
howdy
hello
# cat 2
hello
hello
hello
  1. Use different ways to diff the files:
# diff 1 2 > diff-default.diff
# diff -u 1 2 > diff-u.diff
# diff -c 1 2 > diff-c.diff
  1. Open the diffs in editors and check:
  • Zed (uses this repo):
Image
  • Sublime Text (uses a different implementation):
Image

As all diff formats seem to follow the same "first column decides the operation" rule, I'd be happy if the most impactful characters <, > and ! were added into the highlighting. The diff format-specific headers are nice to have, but I'm mainly looking for the improvement to diff.plus, diff.minus and (if it even exists) diff.change syntax types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions