Skip to content

Commit

Permalink
Merge pull request #31 from warpy-ai/fix_list
Browse files Browse the repository at this point in the history
feat(Cargo.toml): update version to 0.1.4
  • Loading branch information
jucasoliveira authored Aug 31, 2024
2 parents 0fcfe38 + 9c3562b commit 865bdb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rustubble"
version = "0.1.3"
version = "0.1.4"
edition = "2021"
authors = ["Lucas Oliveira <[email protected]>"] # List of crate authors.
description = "A brief description of what your crate does."
Expand Down
16 changes: 5 additions & 11 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ use ratatui::{
Terminal,
};

use crate::{
command::{CommandInfo},
help::HelpComponent,
};
use crate::{command::CommandInfo, help::HelpComponent};

#[derive(Clone)]
pub struct Item {
Expand Down Expand Up @@ -202,7 +199,7 @@ impl ItemList {
}
}

pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
pub fn handle_list(list: &mut ItemList, _x: u16, _y: u16) -> Option<String> {
let stdout = io::stdout();
let backend = CrosstermBackend::new(stdout);
let mut terminal = Terminal::new(backend).unwrap();
Expand Down Expand Up @@ -232,11 +229,8 @@ pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
help_component.deactivate_filter_mode();
}

list.render(
&mut terminal,
Rect::new(x, y, 40, 50),
&mut help_component.clone(),
);
let size = terminal.size().unwrap();
list.render(&mut terminal, size, &mut help_component.clone());

if let Event::Key(KeyEvent {
code, modifiers, ..
Expand Down Expand Up @@ -267,7 +261,7 @@ pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
_ => {}
}
}
list.render(&mut terminal, Rect::new(x, y, 40, 50), &mut help_component);
list.render(&mut terminal, size, &mut help_component);
}
}

Expand Down

0 comments on commit 865bdb9

Please sign in to comment.