diff --git a/src/editor.rs b/src/editor.rs index 9b0b0b1..fde95a6 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -377,10 +377,9 @@ impl Editor { } pub fn cursor_right(&mut self, n: usize) { - if self.cursor.range.1 <= (self.buffer.grapheme_count() - n) { - self.cursor.range.1 += n; - } - else { + self.cursor.range.1 += n; + + if self.cursor.range.1 > self.buffer.grapheme_count() { self.cursor.range.1 = self.buffer.grapheme_count(); } diff --git a/todo.md b/todo.md index ff680d6..b1ef588 100644 --- a/todo.md +++ b/todo.md @@ -3,8 +3,8 @@ - Line number display - File opening by entering path - UI that wraps editors, for split view. -- Redo functionality - +- Persistent infinite undo +- "Projects" - Clean up text buffer interface: - Editing (these are undoable):