1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-01-28 03:29:41 +02:00
chroma/formatters
Johan Walles 876fb612a7
Pager friendly terminal formatting (#1006)
Let's say a pager, like [moar](https://github.com/walles/moar) (uses
Chroma for syntax highlighting) or `less`, shows a line in the middle of
a file.

Unless that line starts with the correct formatting for the line, the
pager would have to scan the whole file from the start to get the
coloring of this single line right.

Before this PR, lines were not guaranteed to start with formatting, but
could sometimes rely on formatting from the preceding lines.

With this change in place, lines can now stand by themselves, and paging
will work better on Chroma's output.

Missing formatting at the start of the line would happen when a token
had a linefeed in the middle.
2024-10-03 07:20:59 +10:00
..
2022-01-27 15:22:00 +11:00
2024-08-25 16:37:15 +10:00
2022-01-27 15:22:00 +11:00