pub struct NoteEditorState<'a> {
pub content: String,
pub view: View,
pub cursor: Cursor,
pub ast_nodes: Vec<Node>,
pub virtual_document: VirtualDocument<'a>,
pub symbols: Symbols,
/* private fields */
}Fields§
§content: String§view: View§cursor: Cursor§ast_nodes: Vec<Node>§virtual_document: VirtualDocument<'a>§symbols: SymbolsImplementations§
Source§impl<'a> NoteEditorState<'a>
impl<'a> NoteEditorState<'a>
pub fn new( content: &str, filename: &str, filepath: &Path, symbols: &Symbols, ) -> Self
pub fn viewport(&self) -> &Viewport
pub fn is_editing(&self) -> bool
pub fn insert_mode(&self) -> bool
pub fn set_insert_mode(&mut self, mode: bool)
pub fn vim_mode(&self) -> bool
pub fn set_vim_mode(&mut self, mode: bool)
pub fn editor_enabled(&self) -> bool
pub fn set_editor_enabled(&mut self, enabled: bool)
pub fn text_buffer(&self) -> Option<&TextBuffer>
pub fn enter_insert(&mut self, block_idx: usize)
Sourcepub fn commit_text_buffer(&mut self) -> bool
pub fn commit_text_buffer(&mut self) -> bool
Write the current text_buffer back to self.content if it was modified, re-parse AST nodes. Returns true if content changed.
pub fn exit_insert(&mut self)
pub fn set_filename(&mut self, name: &str)
pub fn set_filepath(&mut self, path: &Path)
pub fn insert_char(&mut self, c: char)
pub fn delete_char(&mut self)
pub fn active(&self) -> bool
pub fn current_block(&self) -> usize
pub fn set_view(&mut self, view: View)
pub fn resize_viewport(&mut self, size: Size)
pub fn set_active(&mut self, active: bool)
pub fn modified(&self) -> bool
pub fn cursor_word_forward(&mut self)
pub fn cursor_word_backward(&mut self)
pub fn cursor_left(&mut self, amount: usize)
pub fn cursor_right(&mut self, amount: usize)
pub fn cursor_to_end(&mut self)
pub fn cursor_jump(&mut self, idx: usize)
pub fn update_layout(&mut self)
pub fn cursor_up(&mut self, amount: usize)
pub fn cursor_down(&mut self, amount: usize)
pub fn save_to_file(&mut self) -> Result<()>
Trait Implementations§
Source§impl<'a> Clone for NoteEditorState<'a>
impl<'a> Clone for NoteEditorState<'a>
Source§fn clone(&self) -> NoteEditorState<'a>
fn clone(&self) -> NoteEditorState<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for NoteEditorState<'a>
impl<'a> Debug for NoteEditorState<'a>
Source§impl<'a> Default for NoteEditorState<'a>
impl<'a> Default for NoteEditorState<'a>
Source§fn default() -> NoteEditorState<'a>
fn default() -> NoteEditorState<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for NoteEditorState<'a>
impl<'a> RefUnwindSafe for NoteEditorState<'a>
impl<'a> Send for NoteEditorState<'a>
impl<'a> Sync for NoteEditorState<'a>
impl<'a> Unpin for NoteEditorState<'a>
impl<'a> UnsafeUnpin for NoteEditorState<'a>
impl<'a> UnwindSafe for NoteEditorState<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more