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>

source

pub fn from_str(options: Options, content: &str) -> Self

source

pub fn text_buffer(&self) -> &TextBuffer

source

pub fn set_selection(&mut self, start: Point2<i32>, end: Point2<i32>)

source

pub fn selection(&self) -> &Selection

source

pub fn selected_text(&self) -> Option<String>

source

pub fn cut_selected_text(&mut self) -> Option<String>

source

pub fn is_selected(&self, loc: Point2<i32>) -> bool

source

pub fn clear_selection(&mut self)

source

pub fn set_selection_start(&mut self, start: Point2<i32>)

source

pub fn set_selection_end(&mut self, end: Point2<i32>)

source

pub fn get_char(&self, loc: Point2<usize>) -> Option<char>

source

pub fn get_position(&self) -> Point2<usize>

source

pub fn get_content(&self) -> String

source

pub fn total_lines(&self) -> usize

source§

impl<XMSG> Editor<XMSG>

source

pub fn process_commands( &mut self, commands: impl IntoIterator<Item = Command> ) -> Vec<XMSG>

source

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

source

pub fn clear(&mut self)

source

pub fn numberline_wide(&self) -> usize

Trait Implementations§

source§

impl<XMSG: Default> Default for Editor<XMSG>

source§

fn default() -> Editor<XMSG>

Returns the “default value” for a type. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

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

Checks if self is actually part of its subset T (and can be converted to it).
§

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

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.