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

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

Extension of FormattableText allowing editing

Required methods

Set unformatted text

Existing contents and formatting are replaced entirely.

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).

Replace text at range with replace_with

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

Provided methods

Swap the contiguous unformatted text with another string

Any formatting present is removed.

Implementations on Foreign Types

Implementors