From badd6a0b71b42d87f1013d1a136ee271cb6825cd Mon Sep 17 00:00:00 2001 From: Roux Date: Wed, 12 Apr 2023 00:10:32 -0400 Subject: [PATCH] fixed outdated code --- src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6a41a01..dc6b24a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -198,8 +198,7 @@ impl State { 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.buffer.insert_char(self.cursor, '\n'); self.mode = Mode::Insert(state); } KeyCode::Char(':') => {