From c2bf6c58e5d651a8191825c0c9bf35237cbb502c Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 29 Dec 2023 20:41:10 +0100 Subject: [PATCH] suggestion: added style supports reverse highlighting using nu.config ```nushell style: { text: white selected_text: { attr: r } description_text: white_dimmed } ``` --- src/completion/base.rs | 4 ++++ src/completion/default.rs | 22 +++++++++++++--------- src/completion/history.rs | 1 + src/engine.rs | 2 +- src/menu/columnar_menu.rs | 21 +++++++++++++++++---- src/menu/menu_functions.rs | 2 ++ 6 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/completion/base.rs b/src/completion/base.rs index 3de63c8d..46937892 100644 --- a/src/completion/base.rs +++ b/src/completion/base.rs @@ -1,3 +1,5 @@ +use nu_ansi_term::Style; + /// A span of source code, with positions in bytes #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Ord, PartialOrd, Hash)] pub struct Span { @@ -60,6 +62,8 @@ pub struct Suggestion { pub value: String, /// Optional description for the replacement pub description: Option, + /// Optional style for the replacement + pub style: Option