Struct liner::Editor [] [src]

pub struct Editor<'a, W: Write> {
    pub no_eol: bool,
    // some fields omitted
}

Fields

Methods

impl<'a, W: Write> Editor<'a, W>
[src]

Attempts to undo an action on the current buffer.

Returns Ok(true) if an action was undone. Returns Ok(false) if there was no action to undo.

Deletes the word preceding the cursor. If ignore_space_before_cursor is true and there is space directly before the cursor, this method ignores that space until it finds a word. If ignore_space_before_cursor is false and there is space directly before the cursor, nothing is deleted.

Clears the screen then prints the prompt and current buffer.

Move up (backwards) in history.

Move down (forwards) in history, or to the new buffer if we reach the end of history.

Moves to the start of history (ie. the earliest history entry).

Moves to the end of history (ie. the new buffer).

Inserts a string directly after the cursor, moving the cursor to the right.

Note: it is more efficient to call insert_chars_after_cursor() directly.

Inserts a character directly after the cursor, moving the cursor to the right.

Inserts characters directly after the cursor, moving the cursor to the right.

Deletes the character directly before the cursor, moving the cursor to the left. If the cursor is at the start of the line, nothing happens.

Deletes the character directly after the cursor. The cursor does not move. If the cursor is at the end of the line, nothing happens.

Deletes every character preceding the cursor until the beginning of the line.

Deletes every character after the cursor until the end of the line.

Deletes every character from the cursor until the given position.

Deletes every character from the cursor until the given position, inclusive.

Moves the cursor to the left by count characters. The cursor will not go past the start of the buffer.

Moves the cursor to the right by count characters. The cursor will not go past the end of the buffer.

Moves the cursor to pos. If pos is past the end of the buffer, it will be clamped.

Moves the cursor to the start of the line.

Moves the cursor to the end of the line.

Returns a reference to the current buffer being edited. This may be the new buffer or a buffer from history.

Returns a mutable reference to the current buffer being edited. This may be the new buffer or a buffer from history.

Accept autosuggestion and copy its content into current buffer

Gets the width of the part of the autosuggestion that hasn't been typed.

Deletes the displayed prompt and buffer, replacing them with the current prompt and buffer