From a62e461e38482ade15c6826e656393d5f867488a Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 9 Mar 2023 10:39:28 +0800 Subject: feat: support conversation (#48) --- src/repl/init.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/repl/init.rs') diff --git a/src/repl/init.rs b/src/repl/init.rs index 998b9d0..a14265c 100644 --- a/src/repl/init.rs +++ b/src/repl/init.rs @@ -11,7 +11,6 @@ use reedline::{ use std::borrow::Cow; const MENU_NAME: &str = "completion_menu"; -const DEFAULT_PROMPT_INDICATOR: &str = "〉"; const DEFAULT_MULTILINE_INDICATOR: &str = "::: "; pub struct Repl { @@ -140,7 +139,12 @@ impl Prompt for ReplPrompt { } fn render_prompt_indicator(&self, _prompt_mode: reedline::PromptEditMode) -> Cow { - Cow::Borrowed(DEFAULT_PROMPT_INDICATOR) + let config = self.0.lock(); + if config.conversation.is_some() { + Cow::Borrowed("$") + } else { + Cow::Borrowed("〉") + } } fn render_prompt_multiline_indicator(&self) -> Cow { -- cgit v1.2.3