need to fix pop selection in renderer

This commit is contained in:
victor 2025-08-31 20:59:08 +02:00
parent df67c432f3
commit 5df4c42a7a

View File

@ -53,6 +53,7 @@ pub enum RenderCommand {
#[allow(dead_code)]
impl Renderer {
pub fn new(layout: RenderLayoutKind) -> Self {
todo!("Fix renderer idx in select mode");
Self {
buffer: String::new(),
exit: false,
@ -152,13 +153,13 @@ impl Renderer {
pub fn handle_arrow_key(&mut self, key: KeyCode) {
match &mut self.mode {
InputMode::Input => {}
InputMode::PopUp(content, .., idx) => {
InputMode::PopUp(ref content, .., idx) => {
log(msg!(DEBUG, "Received keycode: {key}"));
log(msg!(DEBUG, "idx before: {idx}"));
match key {
KeyCode::Up => { *idx = idx.saturating_sub(1) }
KeyCode::Down => {
if *idx < content.len().saturating_sub(1) {
if *idx < content.len() {
*idx += 1;
}
}