From 34ae12cb252d156cfc87bedd502c6cac899185c8 Mon Sep 17 00:00:00 2001 From: feraxhp Date: Mon, 5 Oct 2026 19:53:32 -0500 Subject: [PATCH 1/3] feat: terminal theme distinguishes arguments and flags --- src/highlight.rs | 3 ++- tests/cli.rs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/highlight.rs b/src/highlight.rs index 2ab048c..d08a625 100644 --- a/src/highlight.rs +++ b/src/highlight.rs @@ -82,10 +82,11 @@ fn ansi_theme() -> Theme { false, ), ( - "entity.name.function, support.function, meta.function-call", + "entity.name.function, support.function, variable.function", ansi(4), false, ), + ("variable.parameter", ansi(6), false), ("entity.name.tag", ansi(4), false), ("entity.other.attribute-name", ansi(3), false), ("variable.language, support.constant", ansi(1), false), diff --git a/tests/cli.rs b/tests/cli.rs index e886231..03968d3 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -182,6 +182,23 @@ fn terminal_theme_emits_only_palette_colours() { ); } +#[test] +fn terminal_theme_bash_highlighting_distinguishes_arguments_and_flags() { + ink() + .args([ + "--plain", "--color", "always", "--theme", "terminal", "--width", "80", + ]) + .write_stdin("```bash\ngit commit -m \"feat\"\n```\n") + .assert() + .success() + .stdout( + predicate::str::contains("\x1b[34mgit") + .and(predicate::str::contains("\x1b[39m commit")) + .and(predicate::str::contains("\x1b[36m -")) + .and(predicate::str::contains("\x1b[32mfeat")), + ); +} + #[test] fn doctor_reports_without_a_tty() { // In a test harness stdout is a pipe: the protocol query must be skipped From fdb6f3ac833b6d7ef3a05e83e4d9c05d6261cad1 Mon Sep 17 00:00:00 2001 From: feraxhp Date: Mon, 5 Oct 2026 20:28:12 -0500 Subject: [PATCH 2/3] fix: json and css colors --- src/highlight.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/highlight.rs b/src/highlight.rs index d08a625..b9918cb 100644 --- a/src/highlight.rs +++ b/src/highlight.rs @@ -63,6 +63,11 @@ fn ansi_theme() -> Theme { // (scopes, palette slot, italic) let rules: &[(&str, Color, bool)] = &[ ("comment, punctuation.definition.comment", ansi(8), true), + ( + "meta.structure.dictionary.key, meta.structure.dictionary.key string, meta.structure.dictionary.key punctuation.definition.string, meta.mapping.key, meta.mapping.key string, meta.mapping.key punctuation.definition.string, support.type.property-name", + ansi(4), + false, + ), ("string, punctuation.definition.string", ansi(2), false), ("constant.character.escape", ansi(6), false), ( @@ -70,6 +75,11 @@ fn ansi_theme() -> Theme { ansi(3), false, ), + ( + "constant.other.color, punctuation.definition.constant.css", + ansi(5), + false, + ), ( "keyword, storage.modifier, storage.type.function", ansi(5), @@ -89,8 +99,21 @@ fn ansi_theme() -> Theme { ("variable.parameter", ansi(6), false), ("entity.name.tag", ansi(4), false), ("entity.other.attribute-name", ansi(3), false), + ("support.constant.property-value", ansi(3), false), ("variable.language, support.constant", ansi(1), false), ("markup.heading", ansi(4), false), + ("meta.diff.header.from-file", ansi(1), false), + ("meta.diff.header.to-file", ansi(2), false), + ( + "punctuation.definition.from-file, punctuation.definition.to-file, punctuation.definition.inserted, punctuation.definition.deleted", + ansi(5), + false, + ), + ( + "meta.diff.range, punctuation.definition.range.diff", + ansi(6), + false, + ), ("markup.inserted", ansi(2), false), ("markup.deleted", ansi(1), false), ("invalid", ansi(1), false), From f78827c40398c109c2c098bdf187b60c599c549b Mon Sep 17 00:00:00 2001 From: feraxhp Date: Mon, 5 Oct 2026 20:35:11 -0500 Subject: [PATCH 3/3] fix: rust macros on blue --- src/highlight.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/highlight.rs b/src/highlight.rs index b9918cb..e71f45d 100644 --- a/src/highlight.rs +++ b/src/highlight.rs @@ -92,7 +92,7 @@ fn ansi_theme() -> Theme { false, ), ( - "entity.name.function, support.function, variable.function", + "entity.name.function, support.function, variable.function, support.macro, entity.name.function.macro, entity.name.macro, punctuation.definition.macro", ansi(4), false, ),