From 03a1baba6c2403e172e7eb1d4ad0c3175376c916 Mon Sep 17 00:00:00 2001 From: maxomatic458 <104733404+maxomatic458@users.noreply.github.com> Date: Fri, 26 Jan 2024 02:25:32 +0100 Subject: [PATCH] add style from #691 to ide menu (#722) * get correct cursor pos when menu indicator contains newline * add tests * fix cursor pos in multiline prompt * make description mode enum public * add doc comment * respect windows newline in update_values * Revert "respect windows newline in update_values" This reverts commit 070d600545737b53bc9f48e7b9e93cf9fa8fc171. * add complete_with_base_ranges to Completer * add builder for correct_cursor_pos * add config options to completion examples * add style to ide menu * run fmt * start menu refactor * Revert "start menu refactor" This reverts commit 62726f29bea0067e5860cc2a0cbace460d59517c. --- src/menu/ide_menu.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/menu/ide_menu.rs b/src/menu/ide_menu.rs index c2ef4b6..7ff1d29 100644 --- a/src/menu/ide_menu.rs +++ b/src/menu/ide_menu.rs @@ -559,8 +559,13 @@ impl IdeMenu { if use_ansi_coloring { if index == self.index() { format!( - "{}{}{}{}{}{}{}", + "{}{}{}{}{}{}{}{}", vertical_border, + suggestion + .style + .unwrap_or(self.color.text_style) + .reverse() + .prefix(), self.color.selected_text_style.prefix(), " ".repeat(padding), string, @@ -572,7 +577,7 @@ impl IdeMenu { format!( "{}{}{}{}{}{}{}", vertical_border, - self.color.text_style.prefix(), + suggestion.style.unwrap_or(self.color.text_style).prefix(), " ".repeat(padding), string, " ".repeat(padding_right),