diff --git a/src/highlight/highlight.rs b/src/highlight/highlight.rs index eac7ba676..607420847 100644 --- a/src/highlight/highlight.rs +++ b/src/highlight/highlight.rs @@ -76,6 +76,9 @@ pub fn colorize(text: &wstr, colors: &[HighlightSpec], vars: &dyn Environment) - outp.set_text_face(face); last_color = color; } + if i + 1 == text.char_count() && c == '\n' { + outp.set_text_face(TextFace::default()); + } outp.writech(c); } outp.set_text_face(TextFace::default()); diff --git a/tests/checks/indent.fish b/tests/checks/indent.fish index c3afa9986..ff8dd09da 100644 --- a/tests/checks/indent.fish +++ b/tests/checks/indent.fish @@ -494,6 +494,12 @@ echo $status #CHECK: 0 echo 'PATH={$PATH[echo " "' | $fish_indent --ansi # CHECK: PATH={$PATH[echo " " +fish_config theme choose "ayu Dark" +echo -n 'echo hello' | builtin fish_indent --ansi +echo end +# CHECK: {{\x1b\[38;2;57;186;230mecho\x1b\[38;2;179;177;173m hello\x1b\[38;2;242;150;104m\x1b\[m}} +# CHECK: end + echo a\> | $fish_indent # CHECK: a >