Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d97a424

Browse files
committed
refactor(renderer): Extract more DecorStyle style
1 parent b0950c4 commit d97a424

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎src/renderer/mod.rs‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2403,11 +2403,7 @@ impl Renderer {
24032403
col: usize,
24042404
is_cont: bool,
24052405
) {
2406-
let chr = match self.decor_style {
2407-
DecorStyle::Ascii => "= ",
2408-
DecorStyle::Unicode if is_cont => "├ ",
2409-
DecorStyle::Unicode => "╰ ",
2410-
};
2406+
let chr = self.decor_style.note_separator(is_cont);
24112407
buffer.puts(line, col, chr, ElementStyle::LineNumber);
24122408
}
24132409

@@ -2827,6 +2823,14 @@ impl DecorStyle {
28272823
}
28282824
}
28292825

2826+
fn note_separator(&self, is_cont: bool) -> &str {
2827+
match self {
2828+
DecorStyle::Ascii => "= ",
2829+
DecorStyle::Unicode if is_cont => "├ ",
2830+
DecorStyle::Unicode => "╰ ",
2831+
}
2832+
}
2833+
28302834
fn multi_suggestion_separator(&self) -> &'static str {
28312835
match self {
28322836
DecorStyle::Ascii => "|",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /