Skip to content

πŸš€ Tweak --list-themes outputΒ #170

@lydell

Description

@lydell

Hi! Thanks for this tool, I love it.

When I ran delta --list-themes for the first time I was pleasantly surprised – I expected a list of theme names to be printed, but you also get an example of each theme. Very helpful!

When scrolling somewhere in the middle, though, it’s hard to know which theme is which:

     println!("The square of {:.2} is {:.2}.", num, result);
 // Output the cube of a number.
 fn print_cube(num: f64) {
     let result = f64::powf(num, 3.0);
     println!("The cube of {:.2} is {:.2}.", num, result);
 }

Theme: TwoDark


example.rs
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

1
 // Output the square of a number.
 fn print_square(num: f64) {
     let result = f64::powf(num, 2.0);
     println!("The square of {:.2} is {:.2}.", num, result);
 // Output the cube of a number.
 fn print_cube(num: f64) {
     let result = f64::powf(num, 3.0);
     println!("The cube of {:.2} is {:.2}.", num, result);
 }

Theme: ansi-dark


example.rs
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

1
 // Output the square of a number.
 fn print_square(num: f64) {
     let result = f64::powf(num, 2.0);
     println!("The square of {:.2} is {:.2}.", num, result);
 // Output the cube of a number.
 fn print_cube(num: f64) {
     let result = f64::powf(num, 3.0);
     println!("The cube of {:.2} is {:.2}.", num, result);
 }

Theme: ansi-light


example.rs
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

1
 // Output the square of a number.
 fn print_square(num: f64) {
     let result = f64::powf(num, 2.0);
     println!("The square of {:.2} is {:.2}.", num, result);

In the above example, it looks like we first see a bit of β€œTwoDark”, then β€œansi-dark”, then β€œansi-light” and a little bit of yet another theme. But that’s not the case! I’m off-by-one! We’re actually seeing a little bit of some theme, then β€œTwoDark”, then β€œansi-dark” and finally a bit of β€œansi-light”.

I think the confusion comes from the long ──────── lines combined with Theme: name being positioned closer to the previous theme than the theme it belongs to, almost like an image caption.

Ideas:

  • At least put Theme: name closer to the theme it belongs to than other themes.
  • Show name instead of example.rs?
  • Put the theme after the example (as an β€œimage caption”) like my brain interprets the current design?

Btw, is there a theme with 0 green and red in it? I get confused sometimes about what is inserted/deleted and what is just syntax highlighted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions