From deeb489b4e830d87aa719ad48a87ff4c18486d53 Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Mon, 17 Aug 2026 06:55:07 -0400 Subject: [PATCH] v0.3.0 : menu d autocompletion - les barres verticales des menus en colonne unique (ex. completion de theme) prennent la couleur du cadre du theme --- src/repl.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/repl.rs b/src/repl.rs index e90130b..f109326 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -379,6 +379,16 @@ impl Highlighter for AmCompleter { bar )) } + } else if cells.len() == 3 { + // Single-column menu (no descriptions, e.g. the theme + // names): paint the bars and the name. + let bar = self.theme.get().frame("│"); + Cow::Owned(format!( + "{}{}{}", + bar, + self.theme.get().acc(cells[1]), + bar + )) } else { Cow::Borrowed(candidate) } @@ -1775,6 +1785,22 @@ mod tests { assert!(widths.iter().all(|w| *w == widths[0]), "unaligned box:\n{text}"); } + #[test] + fn completion_menu_paints_single_column_bars() { + let c = completer(); + c.set_theme(crate::theme::find("ocean").unwrap()); + let row = "│ ocean │"; + let out = c.highlight_candidate(row, rustyline::CompletionType::List); + assert!( + out.contains("\x1b[38;5;75m"), + "bars not painted with the frame color: {out}" + ); + assert!( + out.contains("\x1b[1;38;5;81m"), + "name not painted with the accent color: {out}" + ); + } + #[test] fn banner_top_border_right_dashes_keep_the_frame_color() { let session = test_session();