Merge pull request 'o-insert' (#5) from roux/breed:o-insert into main

Reviewed-on: #5
This commit is contained in:
mars 2023-04-12 04:21:45 +00:00
commit b048eba60c
1 changed files with 13 additions and 0 deletions

View File

@ -194,6 +194,19 @@ 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;
self.buffer.insert_char(self.cursor, '\n');
self.mode = Mode::Insert(state);
}
KeyCode::Char('O') => {
let state = InsertState { append: false };
self.cursor.column = 0;
self.buffer.insert_char(self.cursor, '\n');
self.mode = Mode::Insert(state);
}
KeyCode::Char(':') => {
self.mode = Mode::Command(Default::default());
}