Trait reedline::Prompt [−][src]
pub trait Prompt {
fn render_prompt(&self, screen_width: usize) -> Cow<'_, str>;
fn render_prompt_indicator(
&self,
prompt_mode: PromptEditMode
) -> Cow<'_, str>;
fn render_prompt_multiline_indicator(&self) -> Cow<'_, str>;
fn render_prompt_history_search_indicator(
&self,
history_search: PromptHistorySearch
) -> Cow<'_, str>;
fn get_prompt_color(&self) -> Color { ... }
}
Expand description
API to provide a custom prompt.
Implementors have to provide str
-based content which will be
displayed before the LineBuffer
is drawn.
Required methods
fn render_prompt(&self, screen_width: usize) -> Cow<'_, str>
fn render_prompt(&self, screen_width: usize) -> Cow<'_, str>
Provide content off the full prompt. May use a line above the entry buffer that fits into screen_width
.
fn render_prompt_indicator(&self, prompt_mode: PromptEditMode) -> Cow<'_, str>
fn render_prompt_indicator(&self, prompt_mode: PromptEditMode) -> Cow<'_, str>
Render the default prompt indicator
fn render_prompt_multiline_indicator(&self) -> Cow<'_, str>
fn render_prompt_multiline_indicator(&self) -> Cow<'_, str>
Render the default prompt indicator
fn render_prompt_history_search_indicator(
&self,
history_search: PromptHistorySearch
) -> Cow<'_, str>
fn render_prompt_history_search_indicator(
&self,
history_search: PromptHistorySearch
) -> Cow<'_, str>
Render the default prompt indicator
Provided methods
fn get_prompt_color(&self) -> Color
fn get_prompt_color(&self) -> Color
Render the vi insert mode prompt indicator Get back the prompt color