Struct zaplib_components::TextCursorSet
source · [−]pub struct TextCursorSet {
pub set: Vec<TextCursor>,
pub last_cursor: usize,
pub insert_undo_group: u64,
pub last_clamp_range: Option<(usize, usize)>,
}
Fields
set: Vec<TextCursor>
last_cursor: usize
insert_undo_group: u64
last_clamp_range: Option<(usize, usize)>
Implementations
pub fn add_last_cursor_head_and_tail(
&mut self,
head: usize,
tail: usize,
text_buffer: &TextBuffer
)
pub fn clear_and_set_last_cursor_head_and_tail(
&mut self,
head: usize,
tail: usize,
text_buffer: &TextBuffer
)
pub fn set_last_cursor_head_and_tail(
&mut self,
head: usize,
tail: usize,
text_buffer: &TextBuffer
)
pub fn grid_select(
&mut self,
start_pos: TextPos,
end_pos: TextPos,
text_buffer: &TextBuffer
) -> bool
pub fn replace_text(
&mut self,
text: &str,
text_buffer: &mut TextBuffer,
override_group: Option<TextUndoGrouping>
)
pub fn overwrite_if_exists_or_deindent(
&mut self,
thing: &str,
deindent: usize,
text_buffer: &mut TextBuffer
)
pub fn replace_lines_formatted(
&mut self,
out_lines: Vec<Vec<char>>,
text_buffer: &mut TextBuffer
)
Clamp the TextCursor
positons to the total text size of the provided TextBuffer
size.
This is useful in making sure that the position of the TextCursor
is correct when
you set_value of the TextBuffer
to be smaller than before.
pub fn get_nearest_token_chunk_boundary(
left: bool,
offset: usize,
text_buffer: &TextBuffer
) -> usize
pub fn get_nearest_token_chunk(
offset: usize,
text_buffer: &TextBuffer
) -> Option<(usize, usize)>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for TextCursorSet
impl Send for TextCursorSet
impl Sync for TextCursorSet
impl Unpin for TextCursorSet
impl UnwindSafe for TextCursorSet
Blanket Implementations
Mutably borrows from an owned value. Read more