svenssonaxel / diff-format

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

Named snippet syntax is confusing #2

Open svenssonaxel opened 1 year ago

svenssonaxel commented 1 year ago

The named snippet syntax is rather confusing, since a snippet line changes the meaning of other status markers. For example, depending on what sides have an active snippet, the space status marker can have four different meanings:

Similarly, one needs to know what sides have active snippets to understand the status markers +, - and _.

svenssonaxel commented 1 year ago

Proposal:

svenssonaxel commented 1 year ago

The proposal above is implemented on branch master-syntax2, but this introduces new problems: An unlimited number of concurrently active snippets makes it hard to reason about the format in the general case, and impossible to highlight. The best I could do was to limit the number of active snippets to two in the highlighter. Despite all this, it doesn't even seem to actually become easier to read.

On the main branch master-syntax1, commit 416010f introduces a new highlighting scheme: The background color of the status marker indicates what files the content is present in, but the background color of the content still indicates what sides the content is present on. The idea is that you should be more interested in the sides anyway, since this gives you a more semantic understanding of the differences. If you really want the text-level understanding, you can look at the highlighting of the status markers, or convert to unified format.