From 35093e64723e35bb30f1fb83683811442e704469 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Thu, 9 Jan 2020 13:51:44 -0800 Subject: [PATCH] scroll fix --- src/editor/mod.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/editor/mod.rs b/src/editor/mod.rs index 8a7ec3c..b4875b1 100644 --- a/src/editor/mod.rs +++ b/src/editor/mod.rs @@ -134,8 +134,10 @@ impl Editor { } add_character(&mut command, &character, row_index as u64, col_index as u64, new_style.clone()); } else { - add_command(&mut draw_commands, command); - command = None; + let style = command.as_ref().map(|command| command.style.clone()).flatten(); + add_character(&mut command, &' ', row_index as u64, col_index as u64, style); + // add_command(&mut draw_commands, command); + // command = None; } } add_command(&mut draw_commands, command); @@ -203,7 +205,7 @@ impl Editor { } } - pub fn scroll_region(&mut self, top: u64, bot: u64, left: u64, right: u64, rows: i64, cols: i64) { + fn scroll_region(&mut self, top: u64, bot: u64, left: u64, right: u64, rows: i64, cols: i64) { let (top, bot) = if rows > 0 { (top as i64 + rows, bot as i64) } else if rows < 0 { @@ -277,11 +279,3 @@ impl Editor { } } -#[cfg(test)] -mod tests { - #[test] - fn scrolling_test() { - let mut editor = Editor::new(10, 10); - } -} -