chroma icon indicating copy to clipboard operation
chroma copied to clipboard

Support for line numbers with the terminal (ANSI) formatters?

Open prologic opened this issue 6 years ago • 3 comments

I see a few related issues and merged PR that add support for table-based HTMl line numbers.

I don't see similar support for the ANSI / terminal formatters.

Is anyone else interested in this?

prologic avatar Nov 18 '19 02:11 prologic

I've worked around the lack of this feature by doing something like this:

https://github.com/prologic/ed/blob/61c5cac476857fa3c894e5723c0e3e5a7e55b723/commands.go#L88-L116

Which uses:

https://github.com/prologic/ed/blob/61c5cac476857fa3c894e5723c0e3e5a7e55b723/utils.go#L78-L112

prologic avatar Nov 19 '19 02:11 prologic

I think it would be a useful feature to have.

alecthomas avatar Nov 19 '19 03:11 alecthomas

I would put up a PR myself as I'd really like this for ed; sadly however whilst I'm familiar with ANSI sequences and understand them I don't really have the visual/artistic skills to pull this off with the right choice of colours/backgrounds/etc. Maybe someone can chime in here with some suggestions?

prologic avatar Nov 22 '19 03:11 prologic