From e726b2d0f8de40d89919f8aba1368f70006e509a Mon Sep 17 00:00:00 2001 From: Nathan Vegdahl Date: Tue, 13 Jan 2015 00:15:26 -0800 Subject: [PATCH] Fixed some bugs in new multi-cursor code. --- src/editor.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index 8a8f72d..0cdd1d5 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -78,6 +78,12 @@ impl Editor { cursors: vec!(Cursor::new()), }; + // // For multiple-cursor testing + // ed.cursors.push(Cursor::new()); + // ed.cursors[1].range.0 = 30; + // ed.cursors[1].range.1 = 30; + // ed.cursors[1].update_vis_start(&(ed.buffer)); + ed.auto_detect_indentation_style(); return ed; @@ -337,7 +343,7 @@ impl Editor { c.update_vis_start(&(self.buffer)); // Update offset - offset -= len; + offset += len; } // Adjust view @@ -368,7 +374,7 @@ impl Editor { c.update_vis_start(&(self.buffer)); // Update offset - offset -= len; + offset += len; } // Adjust view