pub struct InputPanelState {
pub textarea: TextArea<'static>,
pub edit_selection: EditSelectionState,
pub file_cache: FileCache,
pub fuzzy_finder: FuzzyFinder,
}Expand description
Stateful data for the InputPanel widget.
Fields§
§textarea: TextArea<'static>§edit_selection: EditSelectionState§file_cache: FileCache§fuzzy_finder: FuzzyFinderImplementations§
Source§impl InputPanelState
impl InputPanelState
Sourcepub fn get_cursor_byte_offset(&self) -> usize
pub fn get_cursor_byte_offset(&self) -> usize
Get the byte offset of the cursor in the textarea content
Sourcepub fn is_in_fuzzy_query(&self) -> bool
pub fn is_in_fuzzy_query(&self) -> bool
Check if the fuzzy finder is active and the cursor is in a valid query position
Sourcepub fn get_current_fuzzy_query(&self) -> Option<String>
pub fn get_current_fuzzy_query(&self) -> Option<String>
Get the current fuzzy query if in a valid position
Sourcepub fn complete_picker_item(&mut self, item: &PickerItem)
pub fn complete_picker_item(&mut self, item: &PickerItem)
Complete fuzzy finder by replacing the query text with the selected item’s insert text
Sourcepub fn edit_selection_prev(&mut self) -> Option<&(String, String)>
pub fn edit_selection_prev(&mut self) -> Option<&(String, String)>
Move to previous message in edit selection
Sourcepub fn edit_selection_next(&mut self) -> Option<&(String, String)>
pub fn edit_selection_next(&mut self) -> Option<&(String, String)>
Move to next message in edit selection
Sourcepub fn get_selected_message(&self) -> Option<&(String, String)>
pub fn get_selected_message(&self) -> Option<&(String, String)>
Get the currently selected message
Sourcepub fn populate_edit_selection<'a>(
&mut self,
chat_items: impl Iterator<Item = &'a ChatItem>,
)
pub fn populate_edit_selection<'a>( &mut self, chat_items: impl Iterator<Item = &'a ChatItem>, )
Populate edit selection with messages from chat items
Sourcepub fn get_hovered_edit_id(&self) -> Option<&str>
pub fn get_hovered_edit_id(&self) -> Option<&str>
Get the hovered edit selection ID
Sourcepub fn get_hovered_id(&self) -> Option<&str>
pub fn get_hovered_id(&self) -> Option<&str>
Get the hovered edit selection ID (alias for compatibility)
Sourcepub fn clear_edit_selection(&mut self)
pub fn clear_edit_selection(&mut self)
Clear edit selection
Sourcepub fn activate_fuzzy(&mut self)
pub fn activate_fuzzy(&mut self)
Activate fuzzy finder for files
Sourcepub fn activate_command_fuzzy(&mut self)
pub fn activate_command_fuzzy(&mut self)
Activate fuzzy finder for commands
Sourcepub fn deactivate_fuzzy(&mut self)
pub fn deactivate_fuzzy(&mut self)
Deactivate fuzzy finder
Sourcepub fn fuzzy_active(&self) -> bool
pub fn fuzzy_active(&self) -> bool
Check if fuzzy finder is active
Sourcepub async fn handle_fuzzy_key(
&mut self,
key: KeyEvent,
) -> Option<FuzzyFinderResult>
pub async fn handle_fuzzy_key( &mut self, key: KeyEvent, ) -> Option<FuzzyFinderResult>
Handle key event for fuzzy finder
Sourcepub fn replace_content(&mut self, content: &str, cursor_pos: Option<(u16, u16)>)
pub fn replace_content(&mut self, content: &str, cursor_pos: Option<(u16, u16)>)
Replace the content and optionally set cursor position
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Check if there is content in the textarea
Sourcepub fn insert_str(&mut self, text: &str)
pub fn insert_str(&mut self, text: &str)
Insert string at current cursor position
Sourcepub fn handle_input(&mut self, input: Input)
pub fn handle_input(&mut self, input: Input)
Handle input event (passthrough to textarea)
Sourcepub fn set_content_from_lines(&mut self, lines: Vec<&str>)
pub fn set_content_from_lines(&mut self, lines: Vec<&str>)
Set content from lines
Sourcepub fn file_cache(&self) -> &FileCache
pub fn file_cache(&self) -> &FileCache
Get file cache reference (compatibility method)
Trait Implementations§
Source§impl Debug for InputPanelState
impl Debug for InputPanelState
Auto Trait Implementations§
impl !Freeze for InputPanelState
impl !RefUnwindSafe for InputPanelState
impl Send for InputPanelState
impl Sync for InputPanelState
impl Unpin for InputPanelState
impl !UnwindSafe for InputPanelState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request