Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ default = []
syntax-highlighting = ["tree-sitter-highlight", "tree-sitter-bash"]

[dependencies]
clap = { version = "4.5.47", features = ["derive"] }
clap = { version = "4.6.1", features = ["derive"] }
oneshot = { version = "0.1.12", features = ["std"], default-features = false }
portable-pty = "0.9.0"
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
Expand Down
9 changes: 2 additions & 7 deletions tui/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,8 @@ impl Filter {
} else {
self.items.iter().find_map(|item| {
let mut item_chars = item.node.name.chars();
let mut search_chars = self.search_input.iter();
loop {
// Take the next character from search input first, since we don't want to remove an extra character from the item
let Some(search_char) = search_chars.next() else {
break;
};

let search_chars = self.search_input.iter();
for search_char in search_chars {
// If the item is shorter than the search input, or a character doesn't match, skip this item
let item_char = item_chars.next()?;
if !item_char.eq_ignore_ascii_case(search_char) {
Expand Down
6 changes: 2 additions & 4 deletions tui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,8 @@ fn run(terminal: &mut Terminal<CrosstermBackend<Stdout>>, state: &mut AppState)
return Ok(());
}
}
Event::Mouse(mouse_event) => {
if !state.handle_mouse(&mouse_event) {
return Ok(());
}
Event::Mouse(mouse_event) if !state.handle_mouse(&mouse_event) => {
return Ok(());
}
_ => {}
}
Expand Down
13 changes: 7 additions & 6 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,13 +539,14 @@ impl AppState {
return true;
}

match &mut self.focus {
Focus::FloatingWindow(command) => {
if command.handle_key_event(key) {
self.focus = Focus::List;
}
}
if let Focus::FloatingWindow(command) = &mut self.focus
&& command.handle_key_event(key)
{
self.focus = Focus::List;
return true;
}

match &mut self.focus {
Focus::ConfirmationPrompt(confirm) => {
confirm.content.handle_key_event(key);
match confirm.content.status {
Expand Down
Loading