chrisbra / Colorizer

color hex codes and color names
547 stars 30 forks source link

Color changes are reset at the end of each line (and they shouldn't) #103

Open ruipires opened 1 year ago

ruipires commented 1 year ago

ANSI code are free to change the color and that color will remain changed until it is reset or changed again. Currently (at least in my setup), the color changes are reset with each line.

I am running neovim, loading a file with ansi escape codes and applying them by running :ColorHighlight

chrisbra commented 10 months ago

can you please show an example? It may not work perfectly for the current solution, since we need to parse the ansi color codes and highlight the matching parts in the file, so wondering you this can work.

ruipires commented 9 months ago

This is what I see. The behavior seems to be the same with or without the trailing ^M.

image

The expectation (and the behavior of these on a terminal) is to have the second and third line still formatted according to the color set on the first line, i.e. until the color reset code is found, at the end of the third line.