mirror of
https://github.com/alecthomas/chroma.git
synced 2025-01-28 03:29:41 +02:00
876fb612a7
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.