44clap = { version = "4.5", features = ["cargo", "derive"] }
55nu-ansi-term = { version = "0.50", features = ["derive_serde_style"] }
66ratatui = { version = "0.29", features = ["crossterm"] }
7+ reedline = "0.43"
78strum = { version = "0.27", features = ["derive"] }
89tui-textarea = { version = "0.7", features = ["crossterm", "search"] }
910
@@ -27,12 +28,11 @@ use clap::{CommandFactory, Parser};
2728use edit:: edit_file;
2829use nu_ansi_term:: Color as NuColor ;
2930use ratatui:: crossterm:: event:: { KeyEvent , KeyEventKind } ;
30- use ratatui:: style:: Color ;
3131use reedline:: {
32- default_emacs_keybindings, ColumnarMenu , DefaultCompleter , DefaultHinter , DefaultValidator ,
33- EditCommand , Emacs , ExampleHighlighter , FileBackedHistory , HistoryItem , KeyCode , KeyModifiers ,
34- Keybindings , MenuBuilder , Prompt , PromptEditMode , PromptHistorySearch ,
35- PromptHistorySearchStatus , Reedline , ReedlineEvent , ReedlineMenu , Signal ,
32+ default_emacs_keybindings, Color as ReedLineColor , ColumnarMenu , DefaultCompleter ,
33+ DefaultHinter , DefaultValidator , EditCommand , Emacs , ExampleHighlighter , FileBackedHistory ,
34+ HistoryItem , KeyCode , KeyModifiers , Keybindings , MenuBuilder , Prompt , PromptEditMode ,
35+ PromptHistorySearch , PromptHistorySearchStatus , Reedline , ReedlineEvent , ReedlineMenu , Signal ,
3636} ;
3737use regex:: Regex ;
3838use std:: {
@@ -67,8 +67,7 @@ use thag_rs::{
6767} ;
6868use thag_styling:: {
6969 display_terminal_attributes, display_theme_details, display_theme_roles, ColorInitStrategy ,
70- Role :: { self , Success } ,
71- Style , TermAttributes ,
70+ Role , Style , TermAttributes , ThemedStyle ,
7271} ;
7372use tui_textarea:: { Input , TextArea } ;
7473
@@ -369,12 +368,7 @@ impl Prompt for ReplPrompt {
369368
370369 #[ profiled]
371370 fn get_prompt_color ( & self ) -> reedline:: Color {
372- if let Some ( color_info) = Style :: for_role ( Success ) . foreground {
373- Color :: Indexed ( color_info. index ) . into ( )
374- } else {
375- vprtln ! ( V :: VV , "defaulting to Green" ) ;
376- Color :: Green . into ( )
377- }
371+ lazy_static_var ! ( ReedLineColor , deref, ReedLineColor :: themed( Role :: Success ) )
378372 }
379373}
380374
0 commit comments