Skip to content

Allow to move cursor up and down in multiline editing? #51

@dragoncoder047

Description

@dragoncoder047

In the Python prompt_toolkit (which is used by IPython) multiline editing mode, the history entry is only changed when the user presses 'up' with the cursor on the first line, or 'down' with the cursor on the last line. Anywhere else it just moves the cursor up or down. Can this be added?

The likely fix area would be somewhere around here:

case "[A": // Up arrow
if (this.history) {
let value = this.history.getPrevious();
if (value) {
this.setInput(value);
this.setCursor(value.length);
}
}
break;
case "[B": // Down arrow
if (this.history) {
let value = this.history.getNext();
if (!value) value = "";
this.setInput(value);
this.setCursor(value.length);
}
break;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions