r3bl-org/r3bl-open-core

Overlow with one

Closed this issue · 2 comments

Platform Linux 6.5.7-arch1-1
Terminal software Alacritty

Describe the problem you are observing.

Steps to reproduce

  1. Copy the example of select_from_list
  2. Pass a vector with one element
  3. Try to scroll down.
  4. Panics
use r3bl_rs_utils_core::*;
use r3bl_tuify as tuify;

fn main() {
    let max_width_col_count: usize = tuify::get_size()
        .map(|it| it.col_count)
        .unwrap_or(ch!(80))
        .into();
    let list = vec![format!("one element")];
    tuify::select_from_list(
        "Bug, overflow ".to_owned(),
        list,
        6, /* whatever*/
        max_width_col_count,
        tuify::SelectionMode::Multiple,
        tuify::StyleSheet::default(),
    );
}

Screenshots/Screencaptures

output

@Darioazzali Thanks for sharing this. I will take a look at it now. And we have a discord server if you would like to chat about the issue or PR.

@Darioazzali Yup. This is a bug 🐛 . Repro'd it right away 👍🏽 . Working on a fix now.