Struct liner::Editor [] [src]

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

The core line editor. Displays and provides editing for history and the new buffer.

Fields

Methods

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

[src]

[src]

[src]

None if we're on the new buffer, else the index of history

[src]

[src]

[src]

[src]

[src]

[src]

[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.

[src]

[src]

[src]

[src]

[src]

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.

[src]

Clears the screen then prints the prompt and current buffer.

[src]

Move up (backwards) in history.

[src]

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

[src]

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

[src]

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

[src]

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.

[src]

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

[src]

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

[src]

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.

[src]

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

[src]

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

[src]

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

[src]

Deletes every character from the cursor until the given position.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Moves the cursor to the start of the line.

[src]

Moves the cursor to the end of the line.

[src]

[src]

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

[src]

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

[src]

Accept autosuggestion and copy its content into current buffer

[src]

[src]

[src]

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