Fixed bug in cursor movement code that would result in crashes.
This commit is contained in:
parent
9156f5cf47
commit
d80586e262
|
@ -377,10 +377,9 @@ impl Editor {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cursor_right(&mut self, n: usize) {
|
pub fn cursor_right(&mut self, n: usize) {
|
||||||
if self.cursor.range.1 <= (self.buffer.grapheme_count() - n) {
|
|
||||||
self.cursor.range.1 += n;
|
self.cursor.range.1 += n;
|
||||||
}
|
|
||||||
else {
|
if self.cursor.range.1 > self.buffer.grapheme_count() {
|
||||||
self.cursor.range.1 = self.buffer.grapheme_count();
|
self.cursor.range.1 = self.buffer.grapheme_count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
todo.md
4
todo.md
|
@ -3,8 +3,8 @@
|
||||||
- Line number display
|
- Line number display
|
||||||
- File opening by entering path
|
- File opening by entering path
|
||||||
- UI that wraps editors, for split view.
|
- UI that wraps editors, for split view.
|
||||||
- Redo functionality
|
- Persistent infinite undo
|
||||||
|
- "Projects"
|
||||||
|
|
||||||
- Clean up text buffer interface:
|
- Clean up text buffer interface:
|
||||||
- Editing (these are undoable):
|
- Editing (these are undoable):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user