Skip to content

Commit 865bdb9

Browse files
Merge pull request #31 from warpy-ai/fix_list
feat(Cargo.toml): update version to 0.1.4
2 parents 0fcfe38 + 9c3562b commit 865bdb9

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustubble"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
edition = "2021"
55
authors = ["Lucas Oliveira <jucas.oliveira@gmail.com>"] # List of crate authors.
66
description = "A brief description of what your crate does."

src/list.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use ratatui::{
1010
Terminal,
1111
};
1212

13-
use crate::{
14-
command::{CommandInfo},
15-
help::HelpComponent,
16-
};
13+
use crate::{command::CommandInfo, help::HelpComponent};
1714

1815
#[derive(Clone)]
1916
pub struct Item {
@@ -202,7 +199,7 @@ impl ItemList {
202199
}
203200
}
204201

205-
pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
202+
pub fn handle_list(list: &mut ItemList, _x: u16, _y: u16) -> Option<String> {
206203
let stdout = io::stdout();
207204
let backend = CrosstermBackend::new(stdout);
208205
let mut terminal = Terminal::new(backend).unwrap();
@@ -232,11 +229,8 @@ pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
232229
help_component.deactivate_filter_mode();
233230
}
234231

235-
list.render(
236-
&mut terminal,
237-
Rect::new(x, y, 40, 50),
238-
&mut help_component.clone(),
239-
);
232+
let size = terminal.size().unwrap();
233+
list.render(&mut terminal, size, &mut help_component.clone());
240234

241235
if let Event::Key(KeyEvent {
242236
code, modifiers, ..
@@ -267,7 +261,7 @@ pub fn handle_list(list: &mut ItemList, x: u16, y: u16) -> Option<String> {
267261
_ => {}
268262
}
269263
}
270-
list.render(&mut terminal, Rect::new(x, y, 40, 50), &mut help_component);
264+
list.render(&mut terminal, size, &mut help_component);
271265
}
272266
}
273267

0 commit comments

Comments
 (0)