just icon indicating copy to clipboard operation
just copied to clipboard

Highlight text within backticks when listing recipes

Open neunenak opened this issue 1 year ago • 1 comments

https://github.com/casey/just/issues/2272

neunenak avatar Oct 09 '24 23:10 neunenak

Seems reasonable! Needs some tests though. Should definitely test edge cases, like an unclosed backtick, etc.

casey avatar Oct 10 '24 19:10 casey

I could not wrap my head around what split_inclusive was doing, so I replaced it with a regex. This also avoids color codes sometimes when they aren't needed.

casey avatar Nov 09 '24 19:11 casey

Although this type of highlighting could be nice in theory, the chosen color makes it only worse. The white backtick color stands out too much relative to...everything else in the output, to the point of making just --list output a struggle to read. It's especially distracting in the auto-generated descriptions for aliases.

Was going to check whether changing the backtick highlight to bright blue (0;94) would resolve this while still standing out enough, but can't figure out how to specify bright blue in this part of just code?

laniakea64 avatar Nov 15 '24 17:11 laniakea64

It looks okay for me, but that's probably just my color theme. I can kinda see how it stands out too much See below. Can you post a screenshot of what it looks like for you?

Screenshot 2024-11-16 at 4 10 50 PM

Cyan might be a good choice, since it goes with blue and is bright. It's the same color used for parameters, but that seems fine, and sometimes you use backticks in doc comments to call out what parameters do:

Screenshot 2024-11-16 at 4 15 29 PM

casey avatar Nov 17 '24 00:11 casey

Changed the color to cyan in #2469. Hopefully that looks good in more color schemes!

casey avatar Nov 17 '24 00:11 casey

It looks okay for me, but that's probably just my color theme.

In your color scheme it would be fine for me too.

Can you post a screenshot of what it looks like for you?

Sure.

White -

Screen shot 2024-11-17 1

Cyan -

Screen shot 2024-11-17 2

The cyan is much better, thanks!

laniakea64 avatar Nov 17 '24 16:11 laniakea64