fix: empty vec for listbox to avoid rendering on first edit

This commit is contained in:
ynqa
2024-12-26 22:04:53 +09:00
parent 38812eabb2
commit 4b09bf3d1a

View File

@@ -8,7 +8,12 @@ use std::{
use anyhow::{anyhow, Result};
use clap::Parser;
use crossterm::style::{Attribute, Attributes, Color};
use promkit::{jsonz::format::RowFormatter, listbox, style::StyleBuilder, text_editor};
use promkit::{
jsonz::format::RowFormatter,
listbox::{self, Listbox},
style::StyleBuilder,
text_editor,
};
mod editor;
use editor::Editor;
@@ -190,7 +195,7 @@ async fn main() -> anyhow::Result<()> {
lines: Default::default(),
},
listbox::State {
listbox: Default::default(),
listbox: Listbox::from_displayable(Vec::<String>::new()),
cursor: String::from(" "),
active_item_style: Some(
StyleBuilder::new()