Open svenssonaxel opened 2 years ago
Proposal:
^
characters at the beginning of a hunk header.^
in exactly one snippet column, spaces in any/all other snippet columns, #
as status marker, and then the snippet name. End of snippet is indicated by any snippet line, or end of hunk. As a special case, a snippet with empty name deactivates that column, after which it is illegal to include content for that column using =
..
and =
indicate that this content is not and is, respectively, present in the snippet currently active for that column. After this, the content line continues with the status marker, all of which has only one possible meaning.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.
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_
.