Struct rustyline::line_buffer::LineBuffer [−][src]
pub struct LineBuffer { /* fields omitted */ }
Expand description
Represent the current input (text and cursor position).
The methods do text manipulations or/and cursor movements.
Implementations
Create a new line buffer with the given maximum capacity
.
Converts a buffer into a String
without copying or allocating.
Set line content (buf
) and cursor position (pos
).
Returns the position of the character just after the current cursor position.
Insert the character ch
at current cursor position
and advance cursor position accordingly.
Return None
when maximum buffer size has been reached,
true
when the character has been appended to the end of the line.
Yank/paste text
at current position.
Return None
when maximum buffer size has been reached or is empty,
true
when the character has been appended to the end of the line.
Delete previously yanked text and yank/paste text
at current position.
Move cursor on the left.
Move cursor on the right.
Move cursor to the start of the buffer.
Move cursor to the end of the buffer.
Is cursor at the end of input (whitespaces after cursor is discarded)
Delete the character at the right of the cursor without altering the cursor position. Basically this is what happens with the “Delete” keyboard key. Return the number of characters deleted.
Delete the character at the left of the cursor. Basically that is what happens with the “Backspace” keyboard key.
Kill the text from point to the end of the buffer.
Kill backward from point to the beginning of the line.
Kill backward from point to the beginning of the buffer.
Exchange the char before cursor with the character at cursor.
Moves the cursor to the beginning of previous word.
Delete the previous word, maintaining the cursor at the start of the current word.
Moves the cursor to the end of next word.
Moves the cursor to the same column in the line above
Moves the cursor to the same column in the line above
Move cursor to the matching character position.
Return true
when the search succeeds.
Kill from the cursor to the end of the current word, or, if between words, to the end of the next word.
Delete range specified by cs
search.
Alter the next word.
Transpose two words
Replaces the content between [start
..end
] with text
and positions the cursor to the end of text.
Insert the s
tring at the specified position.
Return true
if the text has been inserted at the end of the line.
Remove the specified range
in the line.
Return the content between current cursor position and mvt
position.
Return None
when the buffer is empty or when the movement fails.