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.
This commit is contained in:
Nathan Vegdahl 2015-02-22 20:35:41 -08:00
parent c532b10f22
commit d3cd1c4b05

View File

@ -328,7 +328,7 @@ impl<T: LineFormatter> Editor<T> {
if self.cursors[0].range.0 < g_first { if self.cursors[0].range.0 < g_first {
self.view_pos.0 = self.cursors[0].range.0; 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)); 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));
} }
} }