pub struct VecBuffer { /* private fields */ }
Expand description

VecBuffer, the default Buffer implementation

It is based on storing the text in a Vector of lines. Regex functionality is imported from the Regex crate.

Implementations

Create a new empty buffer. It is considered saved while unchanged.

Trait Implementations

Return the number of lines stored in the buffer
Return true if the buffer is empty
Get line tagged with given letter. Not found is error
Return the nearest previous/following index in the selection that contains the regex pattern
Set the matched flag on all lines matching given pattern
Get a line with the matched flag set, clearing that line’s flag
Mark a line with a letter, mark with ‘\0’ to clear
Takes a iterator over lines in strings and inserts after given index
Cut the selection from the buffer, into the clipboard
Replace selection with input
Move selection to immediately after index
Insert a copy of the selection immediately after index
Join all lines in selection into one line
Join all lines to one and split into lines of less than given width Returns end of selection after change Read more
Copy selected lines into clipboard
Paste the clipboard contents after given index Leave clipboard unchanged Read more
Perform regex search and replace on the selection changing pattern.0 to pattern.1 Should interpret escape sequences in both patterns. At minimum \n and \. If pattern is empty, should re-use stored pattern from previous s command Returns new end of selection, since it may delete or add lines Beware that it may delete the whole selection just as ‘c’ Read more
Read to the buffer from given path If index is None replaces current buffer with read lines Else inserts read lines after given index Return number of lines read Read more
Write the buffer to given path
Returns true if no changes have been made since last saving
Undo to given numbers of snapshots back (limited by snapshots created) If negative: redo that number of snapshots instead (limited by undone snapshots) Returns error if steps move to invalid snapshot, use undo_range to get limits Read more
Get how far forward/backward redo/undo is possible Returns range of allowed undo arguments Read more
Create a checkpoint to undo/redo to
Return selection as line iterator giving tag and text (‘\0’ as tag value represents absence of tag) Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.