Fix for two bugs from the previous refactor.

This commit is contained in:
Nathan Vegdahl 2020-02-16 17:14:36 +09:00
parent bfeaee602c
commit e5cac79829
3 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,9 @@ edition = "2018"
name = "led"
path = "src/main.rs"
[profile.release]
debug = true
[dependencies]
ropey = "1"
# ropey = { git = "https://github.com/cessen/ropey", branch = "master" }

View File

@ -147,7 +147,7 @@ impl LineFormatter {
// Get the vertical size of the block and the vertical
// position of the char_idx within it.
let block_v_dim = (block_vis_iter.clone().last().unwrap().1).0 + 1;
let block_v_dim = block_vis_iter.clone().last().map(|n| (n.1).0).unwrap_or(0) + 1;
let char_v_pos = block_vis_iter.clone().vpos(char_offset);
// Get the char's vertical position within the block after offset

View File

@ -606,6 +606,8 @@ impl TermUI {
char_index += char_count(&g);
}
screen_line += 1;
}
// If we get here, it means we reached the end of the text buffer