[][src]Trait kas_text::format::EditableText

pub trait EditableText: FormattableText {
    pub fn set_string(&mut self, string: String);
pub fn insert_char(&mut self, index: usize, c: char);
pub fn replace_range(&mut self, range: Range<usize>, replace_with: &str); pub fn swap_string(&mut self, string: &mut String) { ... } }

Extension of FormattableText allowing editing

Required methods

pub fn set_string(&mut self, string: String)[src]

Set unformatted text

Existing contents and formatting are replaced entirely.

pub fn insert_char(&mut self, index: usize, c: char)[src]

Insert a char at the given position

Formatting is adjusted such that it still affects the same chars (i.e. all formatting after index is postponed by the length of the char).

pub fn replace_range(&mut self, range: Range<usize>, replace_with: &str)[src]

Replace text at range with replace_with

Formatting is adjusted such that it still affects the same chars.

Loading content...

Provided methods

pub fn swap_string(&mut self, string: &mut String)[src]

Swap the contiguous unformatted text with another string

Any formatting present is removed.

Loading content...

Implementations on Foreign Types

impl EditableText for String[src]

Loading content...

Implementors

impl EditableText for Markdown[src]

Loading content...