From d3cd1c4b054ce713e84763a4a98b3019f2f6ced6 Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Sun, 22 Feb 2015 20:35:41 -0800 Subject: [PATCH] Fixed bug in Editor::move_view_to_cursor(). Was causing the view to move unecessarily when the cursor is at the end of the buffer. --- src/editor/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor/mod.rs b/src/editor/mod.rs index 1bc605d..ca29337 100644 --- a/src/editor/mod.rs +++ b/src/editor/mod.rs @@ -328,7 +328,7 @@ impl Editor { if self.cursors[0].range.0 < g_first { self.view_pos.0 = self.cursors[0].range.0; } - else if self.cursors[0].range.0 >= g_last { + else if self.cursors[0].range.0 > g_last { self.view_pos.0 = self.formatter.index_offset_vertical_v2d(&self.buffer, self.cursors[0].range.0, -(self.view_dim.0 as isize), (Floor, Floor)); } }