pub struct TextBuffer {
pub lines: Vec<Vec<char>>,
pub undo_stack: Vec<TextUndo>,
pub redo_stack: Vec<TextUndo>,
pub is_loaded: bool,
pub signal: Signal,
pub mutation_id: u64,
pub is_crlf: bool,
pub messages: TextBufferMessages,
pub flat_text: Vec<char>,
pub token_chunks: Vec<TokenChunk>,
pub token_chunks_id: u64,
pub keyboard: TextBufferKeyboard,
}
Fields§
§lines: Vec<Vec<char>>
§undo_stack: Vec<TextUndo>
§redo_stack: Vec<TextUndo>
§is_loaded: bool
§signal: Signal
§mutation_id: u64
§is_crlf: bool
§messages: TextBufferMessages
§flat_text: Vec<char>
§token_chunks: Vec<TokenChunk>
§token_chunks_id: u64
§keyboard: TextBufferKeyboard
Implementations§
Source§impl TextBuffer
impl TextBuffer
pub fn status_loaded() -> StatusId
pub fn status_message_update() -> StatusId
pub fn status_jump_to_offset() -> StatusId
pub fn status_data_update() -> StatusId
pub fn status_keyboard_update() -> StatusId
Source§impl TextBuffer
impl TextBuffer
pub fn with_signal(cx: &mut Cx) -> Self
pub fn from_utf8(data: &str) -> Self
pub fn needs_token_chunks(&mut self) -> bool
pub fn offset_to_text_pos(&self, char_offset: usize) -> TextPos
pub fn offset_to_text_pos_next( &self, query_off: usize, old_pos: TextPos, old_off: usize, ) -> TextPos
pub fn text_pos_to_offset(&self, pos: TextPos) -> usize
pub fn get_nearest_line_range(&self, offset: usize) -> (usize, usize)
pub fn calc_next_line_indent_depth( &self, offset: usize, tabsize: usize, ) -> (usize, usize)
pub fn calc_line_indent_depth(&self, row: usize) -> usize
pub fn calc_backspace_line_indent_depth_and_pair( &self, offset: usize, ) -> (usize, usize)
pub fn calc_deletion_whitespace( &self, offset: usize, ) -> Option<(usize, usize, usize, usize)>
pub fn calc_deindent_whitespace( &self, offset: usize, ) -> Option<(usize, usize, usize)>
pub fn calc_char_count(&self) -> usize
pub fn get_line_count(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_range_as_string(&self, start: usize, len: usize, ret: &mut String)
pub fn get_char(&self, start: usize) -> char
pub fn get_as_string(&self) -> String
pub fn send_textbuffer_loaded_signal(&self, cx: &mut Cx)
pub fn load_from_utf8(&mut self, utf8: &str)
pub fn replace_line( &mut self, row: usize, start_col: usize, len: usize, rep_line: Vec<char>, ) -> Vec<char>
pub fn copy_line(&self, row: usize, start_col: usize, len: usize) -> Vec<char>
pub fn replace_range( &mut self, start: usize, len: usize, rep_lines: Vec<Vec<char>>, ) -> Vec<Vec<char>>
pub fn replace_lines( &mut self, start_row: usize, end_row: usize, rep_lines: Vec<Vec<char>>, ) -> TextOp
pub fn split_string_to_lines(string: &str) -> Vec<Vec<char>>
pub fn replace_lines_with_string( &mut self, start: usize, len: usize, string: &str, ) -> TextOp
pub fn replace_line_with_string( &mut self, start: usize, row: usize, col: usize, len: usize, string: &str, ) -> TextOp
pub fn replace_with_textop(&mut self, text_op: TextOp) -> TextOp
pub fn save_buffer(&mut self)
pub fn undoredo( &mut self, text_undo: TextUndo, cursor_set: &mut TextCursorSet, ) -> TextUndo
pub fn undo(&mut self, grouped: bool, cursor_set: &mut TextCursorSet)
pub fn redo(&mut self, grouped: bool, cursor_set: &mut TextCursorSet)
Trait Implementations§
Source§impl Clone for TextBuffer
impl Clone for TextBuffer
Source§fn clone(&self) -> TextBuffer
fn clone(&self) -> TextBuffer
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for TextBuffer
impl Default for TextBuffer
Source§fn default() -> TextBuffer
fn default() -> TextBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TextBuffer
impl RefUnwindSafe for TextBuffer
impl Send for TextBuffer
impl Sync for TextBuffer
impl Unpin for TextBuffer
impl UnwindSafe for TextBuffer
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