pub struct Document { /* private fields */ }Expand description
Implementations§
Source§impl Document
impl Document
pub fn new(text: &str) -> Self
pub fn model(&self) -> &TextModel
pub fn editor(&mut self) -> Editor<'_>
pub fn rope(&self) -> &Rope
pub fn text(&self) -> String
pub fn len_chars(&self) -> usize
pub fn version(&self) -> u64
pub fn line_ending(&self) -> LineEnding
pub fn options(&self) -> Options
pub fn set_options(&mut self, options: Options)
pub fn selections(&self) -> &Selections
pub fn can_undo(&self) -> bool
pub fn can_redo(&self) -> bool
pub fn checkpoint(&mut self)
Sourcepub fn take_events(&mut self) -> Vec<EditEvent>
pub fn take_events(&mut self) -> Vec<EditEvent>
Returns the edits applied since the last call, in application order. Calls must come at least every 1024 change sets, or older events are lost.
pub fn copy(&mut self) -> String
pub fn set_selections(&mut self, selections: Selections)
pub fn insert(&mut self, text: &str)
pub fn newline(&mut self)
pub fn indent(&mut self)
pub fn delete_backward(&mut self)
pub fn delete_forward(&mut self)
pub fn delete_word_backward(&mut self)
pub fn delete_word_forward(&mut self)
pub fn apply_edits(&mut self, edits: Vec<Edit>)
pub fn cut(&mut self) -> String
pub fn paste(&mut self, text: &str)
pub fn move_left(&mut self, extend: bool)
pub fn move_right(&mut self, extend: bool)
pub fn move_word_left(&mut self, extend: bool)
pub fn move_word_right(&mut self, extend: bool)
pub fn move_up(&mut self, extend: bool)
pub fn move_down(&mut self, extend: bool)
pub fn move_vertical(&mut self, lines: isize, extend: bool)
pub fn move_line_start(&mut self, extend: bool)
pub fn move_line_end(&mut self, extend: bool)
pub fn move_document_start(&mut self, extend: bool)
pub fn move_document_end(&mut self, extend: bool)
pub fn select_all(&mut self)
pub fn add_cursor_vertical(&mut self, below: bool)
pub fn undo(&mut self) -> bool
pub fn redo(&mut self) -> bool
pub fn tab(&mut self)
pub fn indent_lines(&mut self)
pub fn outdent_lines(&mut self)
pub fn move_lines(&mut self, up: bool)
pub fn copy_lines(&mut self, up: bool)
pub fn delete_lines(&mut self)
pub fn insert_line(&mut self, below: bool)
pub fn toggle_line_comment(&mut self)
pub fn toggle_block_comment(&mut self)
pub fn type_char(&mut self, c: char)
pub fn delete_backward_pair(&mut self)
pub fn add_next_occurrence(&mut self)
pub fn select_all_occurrences(&mut self)
pub fn transform_case(&mut self, upper: bool)
pub fn trim_trailing_whitespace(&mut self)
pub fn cursor_undo(&mut self) -> bool
pub fn shrink_selection(&mut self) -> bool
pub fn type_char_in(&mut self, c: char, in_literal: bool)
pub fn expand_selection(&mut self, ranges: &[Range<usize>]) -> bool
pub fn set_language_editing(&mut self, editing: LanguageEditing)
Trait Implementations§
Auto Trait Implementations§
impl Forget for Document
impl Freeze for Document
impl Move for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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
Mutably borrows from an owned value. Read more