Struct reedline::ColumnarMenu

source ·
pub struct ColumnarMenu { /* private fields */ }
Expand description

Menu to present suggestions in a columnar fashion It presents a description of the suggestion if available

Implementations§

source§

impl ColumnarMenu

source

pub fn with_name(self, name: &str) -> Self

Menu builder with new name

source

pub fn with_text_style(self, text_style: Style) -> Self

Menu builder with new value for text style

source

pub fn with_selected_text_style(self, selected_text_style: Style) -> Self

Menu builder with new value for text style

source

pub fn with_description_text_style(self, description_text_style: Style) -> Self

Menu builder with new value for text style

source

pub fn with_columns(self, columns: u16) -> Self

Menu builder with new columns value

source

pub fn with_column_width(self, col_width: Option<usize>) -> Self

Menu builder with new column width value

source

pub fn with_column_padding(self, col_padding: usize) -> Self

Menu builder with new column width value

source

pub fn with_marker(self, marker: String) -> Self

Menu builder with marker

source

pub fn with_only_buffer_difference(self, only_buffer_difference: bool) -> Self

Menu builder with new only buffer difference

Trait Implementations§

source§

impl Default for ColumnarMenu

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Menu for ColumnarMenu

source§

fn name(&self) -> &str

Menu name

source§

fn indicator(&self) -> &str

Menu indicator

source§

fn is_active(&self) -> bool

Deactivates context menu

source§

fn can_quick_complete(&self) -> bool

The columnar menu can to quick complete if there is only one element

source§

fn can_partially_complete( &mut self, values_updated: bool, editor: &mut Editor, completer: &mut dyn Completer ) -> bool

The columnar menu can try to find the common string and replace it in the given line buffer

source§

fn menu_event(&mut self, event: MenuEvent)

Selects what type of event happened with the menu

source§

fn update_values(&mut self, editor: &mut Editor, completer: &mut dyn Completer)

Updates menu values

source§

fn update_working_details( &mut self, editor: &mut Editor, completer: &mut dyn Completer, painter: &Painter )

The working details for the menu changes based on the size of the lines collected from the completer

source§

fn replace_in_buffer(&self, editor: &mut Editor)

The buffer gets replaced in the Span location

source§

fn min_rows(&self) -> u16

Minimum rows that should be displayed by the menu

source§

fn get_values(&self) -> &[Suggestion]

Gets values from filler that will be displayed in the menu

source§

fn menu_required_lines(&self, _terminal_columns: u16) -> u16

Calculates the real required lines for the menu considering how many lines wrap the terminal or if entries have multiple lines
source§

fn menu_string(&self, available_lines: u16, use_ansi_coloring: bool) -> String

Creates the menu representation as a string which will be painted by the painter

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.