svenssonaxel / diff-format

Specification, reference implementations and test battery for Hintful diff format.
Other
10 stars 1 forks source link

Context needed for newline marker #3

Open svenssonaxel opened 1 year ago

svenssonaxel commented 1 year ago

For high readability, each line should preferably be possible to interpret on it's own, with no context. This is not the case for content lines, as the status markers +, - and ` are used in both hintful and unified diff format. This means, that looking at the line+hello$, a user is unable to tell whether this addshello\n(hintful) orhello$\n` (unified), without going back to the hunk header or getting help from a highlighter.

svenssonaxel commented 1 year ago

This is partly alleviated by highlighting.

svenssonaxel commented 1 year ago

Strictly speaking, this problem is already present in unified diff format, since the --- and +++ lines can be confused with - and + content lines given no context. Some highlighters would work faster if lines could be interpreted on their own, but at least we aren't introducing this problem.