pub struct EditorContext {Show 13 fields
pub cursor: usize,
pub selection_start: usize,
pub selection_end: usize,
pub has_selection: bool,
pub selected_text: String,
pub line: usize,
pub col: usize,
pub doc_len: usize,
pub line_count: usize,
pub file_name: String,
pub language: String,
pub theme: String,
pub doc_text: String,
}Expand description
A snapshot of the editor, exposed to scripts as global constants.
Fields§
§cursor: usize§selection_start: usize§selection_end: usize§has_selection: bool§selected_text: String§line: usize§col: usize§doc_len: usize§line_count: usize§file_name: String§language: String§theme: StringThe name of the active color theme, e.g. dark or monokai.
doc_text: StringThe whole buffer as text (not just the selection).
Trait Implementations§
Source§impl Clone for EditorContext
impl Clone for EditorContext
Source§impl Debug for EditorContext
impl Debug for EditorContext
Auto Trait Implementations§
impl Forget for EditorContext
impl Freeze for EditorContext
impl Move for EditorContext
impl RefUnwindSafe for EditorContext
impl Send for EditorContext
impl Sync for EditorContext
impl Unpin for EditorContext
impl UnsafeUnpin for EditorContext
impl UnwindSafe for EditorContext
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