pub struct TextArea { /* private fields */ }Expand description
Implementations§
Source§impl TextArea
impl TextArea
Sourcepub fn line_numbers(self, show: bool) -> Self
pub fn line_numbers(self, show: bool) -> Self
Enable or disable line numbers
Sourcepub fn placeholder(self, text: impl Into<String>) -> Self
pub fn placeholder(self, text: impl Into<String>) -> Self
Set placeholder text
Sourcepub fn selection_bg(self, color: Color) -> Self
pub fn selection_bg(self, color: Color) -> Self
Set selection background color
Sourcepub fn syntax_with_theme(self, language: Language, theme: SyntaxTheme) -> Self
pub fn syntax_with_theme(self, language: Language, theme: SyntaxTheme) -> Self
Enable syntax highlighting with a custom theme
Sourcepub fn set_language(&mut self, language: Language)
pub fn set_language(&mut self, language: Language)
Set the syntax highlighting language (mutable)
Sourcepub fn get_syntax_language(&self) -> Language
pub fn get_syntax_language(&self) -> Language
Get the current highlighting language
Sourcepub fn get_content(&self) -> String
pub fn get_content(&self) -> String
Get the current text content
Sourcepub fn set_content(&mut self, text: &str)
pub fn set_content(&mut self, text: &str)
Set the text content
Sourcepub fn line_count(&self) -> usize
pub fn line_count(&self) -> usize
Get the number of lines
Sourcepub fn cursor_position(&self) -> (usize, usize)
pub fn cursor_position(&self) -> (usize, usize)
Get the cursor position (primary cursor for backward compatibility)
Sourcepub fn cursor_positions(&self) -> Vec<(usize, usize)>
pub fn cursor_positions(&self) -> Vec<(usize, usize)>
Get all cursor positions
Sourcepub fn cursor_count(&self) -> usize
pub fn cursor_count(&self) -> usize
Get the number of cursors
Sourcepub fn set_cursor(&mut self, line: usize, col: usize)
pub fn set_cursor(&mut self, line: usize, col: usize)
Set the cursor position (primary cursor, clears secondary cursors)
Sourcepub fn get_selection(&self) -> Option<String>
pub fn get_selection(&self) -> Option<String>
Get selected text (from primary cursor)
Sourcepub fn delete_selection(&mut self)
pub fn delete_selection(&mut self)
Delete selected text (from primary cursor)
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if primary cursor has a selection
Sourcepub fn start_selection(&mut self)
pub fn start_selection(&mut self)
Start selection at current cursor (primary)
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear selection (all cursors)
Sourcepub fn insert_char(&mut self, ch: char)
pub fn insert_char(&mut self, ch: char)
Insert a character at cursor
Sourcepub fn insert_str(&mut self, s: &str)
pub fn insert_str(&mut self, s: &str)
Insert a string at cursor
Sourcepub fn delete_char_before(&mut self)
pub fn delete_char_before(&mut self)
Delete character before cursor (backspace)
Sourcepub fn delete_char_at(&mut self)
pub fn delete_char_at(&mut self)
Delete character at cursor (delete key)
Sourcepub fn delete_line(&mut self)
pub fn delete_line(&mut self)
Delete the current line
Sourcepub fn duplicate_line(&mut self)
pub fn duplicate_line(&mut self)
Duplicate the current line
Sourcepub fn move_right(&mut self)
pub fn move_right(&mut self)
Move cursor right
Sourcepub fn move_document_start(&mut self)
pub fn move_document_start(&mut self)
Move to start of document
Sourcepub fn move_document_end(&mut self)
pub fn move_document_end(&mut self)
Move to end of document
Sourcepub fn move_word_left(&mut self)
pub fn move_word_left(&mut self)
Move cursor by word to the left
Sourcepub fn move_word_right(&mut self)
pub fn move_word_right(&mut self)
Move cursor by word to the right
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all text
Sourcepub fn open_replace(&mut self)
pub fn open_replace(&mut self)
Open replace panel (Ctrl+H)
Sourcepub fn close_find(&mut self)
pub fn close_find(&mut self)
Close find/replace panel
Sourcepub fn is_find_open(&self) -> bool
pub fn is_find_open(&self) -> bool
Check if find panel is open
Sourcepub fn find_state(&self) -> Option<&FindReplaceState>
pub fn find_state(&self) -> Option<&FindReplaceState>
Get find/replace state
Sourcepub fn set_find_query(&mut self, query: &str)
pub fn set_find_query(&mut self, query: &str)
Set find query and refresh matches
Sourcepub fn set_replace_text(&mut self, text: &str)
pub fn set_replace_text(&mut self, text: &str)
Set replacement text
Sourcepub fn find_previous(&mut self)
pub fn find_previous(&mut self)
Find previous match (Shift+F3)
Sourcepub fn replace_current(&mut self)
pub fn replace_current(&mut self)
Replace current match
Sourcepub fn replace_all(&mut self)
pub fn replace_all(&mut self)
Replace all matches (Ctrl+Shift+H)
Sourcepub fn toggle_case_sensitive(&mut self)
pub fn toggle_case_sensitive(&mut self)
Toggle case sensitivity
Sourcepub fn toggle_whole_word(&mut self)
pub fn toggle_whole_word(&mut self)
Toggle whole word matching
Sourcepub fn toggle_regex(&mut self)
pub fn toggle_regex(&mut self)
Toggle regex mode
Sourcepub fn add_cursor_at(&mut self, line: usize, col: usize)
pub fn add_cursor_at(&mut self, line: usize, col: usize)
Add cursor at position (Alt+Click)
Sourcepub fn add_cursor_above(&mut self)
pub fn add_cursor_above(&mut self)
Add cursor above current (Ctrl+Alt+Up)
Sourcepub fn add_cursor_below(&mut self)
pub fn add_cursor_below(&mut self)
Add cursor below current (Ctrl+Alt+Down)
Sourcepub fn clear_secondary_cursors(&mut self)
pub fn clear_secondary_cursors(&mut self)
Clear all secondary cursors (Escape)
Sourcepub fn select_next_occurrence(&mut self)
pub fn select_next_occurrence(&mut self)
Select next occurrence of current word/selection (Ctrl+D)
Sourcepub fn handle_key(&mut self, key: &Key) -> bool
pub fn handle_key(&mut self, key: &Key) -> bool
Handle key event
Trait Implementations§
Source§impl StyledView for TextArea
impl StyledView for TextArea
Source§fn remove_class(&mut self, class: &str)
fn remove_class(&mut self, class: &str)
Source§fn toggle_class(&mut self, class: &str)
fn toggle_class(&mut self, class: &str)
Auto Trait Implementations§
impl Freeze for TextArea
impl RefUnwindSafe for TextArea
impl Send for TextArea
impl Sync for TextArea
impl Unpin for TextArea
impl UnwindSafe for TextArea
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> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().