forked from mars/breed
1
0
Fork 0

Insert: add o-insert with newline

This commit is contained in:
Roux 2023-04-11 23:54:42 -04:00
parent 9c633b4c72
commit 8a110c5b01
1 changed files with 8 additions and 0 deletions

View File

@ -287,6 +287,14 @@ impl State {
self.move_cursor(Direction::Right);
self.mode = Mode::Insert(state);
}
KeyCode::Char('o') => {
let state = InsertState { append: false};
self.cursor.line += 1;
self.cursor.column = 0;
let index = self.buffer.cursor_to_char(self.cursor);
self.buffer.text.insert(index, "\n");
self.mode = Mode::Insert(state);
}
KeyCode::Char(':') => {
self.mode = Mode::Command(Default::default());
}