Struct ultron_core::editor::Editor
source · pub struct Editor<XMSG> {
pub text_edit: TextEdit,
/* private fields */
}
Expand description
An editor with core functionality platform specific UI
Fields§
§text_edit: TextEdit
Implementations§
source§impl<XMSG> Editor<XMSG>
impl<XMSG> Editor<XMSG>
pub fn from_str(options: Options, content: &str) -> Self
pub fn text_buffer(&self) -> &TextBuffer
pub fn set_selection(&mut self, start: Point2<i32>, end: Point2<i32>)
pub fn selection(&self) -> &Selection
pub fn selected_text(&self) -> Option<String>
pub fn cut_selected_text(&mut self) -> Option<String>
pub fn is_selected(&self, loc: Point2<i32>) -> bool
pub fn clear_selection(&mut self)
pub fn set_selection_start(&mut self, start: Point2<i32>)
pub fn set_selection_end(&mut self, end: Point2<i32>)
pub fn get_char(&self, loc: Point2<usize>) -> Option<char>
pub fn get_position(&self) -> Point2<usize>
pub fn get_content(&self) -> String
pub fn total_lines(&self) -> usize
source§impl<XMSG> Editor<XMSG>
impl<XMSG> Editor<XMSG>
pub fn process_commands( &mut self, commands: impl IntoIterator<Item = Command> ) -> Vec<XMSG>
sourcepub fn process_command(&mut self, command: Command) -> bool
pub fn process_command(&mut self, command: Command) -> bool
TODO: convert this into process_commands where each command marks whether the content has changed or not then once all of the commands have been executed, the emit and rehighlight will commence
TODO option2: have a boolean flag, for each of the command to determine if the editor content changed or not
pub fn clear(&mut self)
pub fn numberline_wide(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl<XMSG> RefUnwindSafe for Editor<XMSG>where XMSG: RefUnwindSafe,
impl<XMSG> Send for Editor<XMSG>where XMSG: Send,
impl<XMSG> Sync for Editor<XMSG>where XMSG: Sync,
impl<XMSG> Unpin for Editor<XMSG>where XMSG: Unpin,
impl<XMSG> UnwindSafe for Editor<XMSG>where XMSG: UnwindSafe,
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
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.