Describe the bug
If there is unnormal char in content, such as "▲" which takes up 3 bytes, when scroll to right horizontally by ">" button, process will exit with error like:
thread 'main' panicked at /Users/zhangzhuang/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/minus-5.6.1/src/core/init.rs:198:12:
called `Result::unwrap()` on an `Err` value: Any { .. }
To Reproduce
use minus::Pager;
use std::fmt::Write;
fn main() {
let mut pager = Pager::new();
let _ = pager.horizontal_scroll(true);
let s = "
fdafadfafasdfasfa fdafa fdaf fdf fdfs fdaf fdf fdf f af sdfasdf fdafaf ▲fdfasdfsa
fadfadf fdaf fdaf ffadfad f f fd fdf
fdfadf f fdaf dsfdafa
fdsfasdf ▲
";
let _ = writeln!(pager, "{}", s);
let _ = writeln!(pager, "{}", s);
let _ = writeln!(pager, "{}", s);
let _ = writeln!(pager, "{}", s);
let _ = writeln!(pager, "{}", s);
let _ = writeln!(pager, "{}", s);
minus::page_all(pager);
}
[dependencies]
minus = { version = "5.6.1", features = ["static_output"] }
run cargo run, then press ">" to scroll right, when " ▲" touches the left side of terminal, there will be an error.
Describe the bug If there is unnormal char in content, such as "▲" which takes up 3 bytes, when scroll to right horizontally by ">" button, process will exit with error like:
To Reproduce
run
cargo run
, then press ">" to scroll right, when " ▲" touches the left side of terminal, there will be an error.Expected behavior No error, process doesn't exit.
Screenshots
Desktop:
minus
Version: 5.6.1Additional context