aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author依云 <lilydjwg@gmail.com>2026-04-03 07:50:48 +0800
committerGitHub <noreply@github.com>2026-04-03 00:50:48 +0100
commit0e84a8a4e6ae744f93cec323d65337282fd661b5 (patch)
tree82b9cd46335d145d9a74ba917cde98c4ff06daaa
parentdocs: remove docker-compose duplication (#3376) (diff)
downloadatuin-0e84a8a4e6ae744f93cec323d65337282fd661b5.zip
fix(ui): when inverted, invert scroll events handling (#3373)
<!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing
-rw-r--r--crates/atuin/src/command/client/search/interactive.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs
index 2910d129..a0b1fe31 100644
--- a/crates/atuin/src/command/client/search/interactive.rs
+++ b/crates/atuin/src/command/client/search/interactive.rs
@@ -180,18 +180,20 @@ impl State {
fn handle_input(&mut self, settings: &Settings, input: &Event) -> InputAction {
match input {
Event::Key(k) => self.handle_key_input(settings, k),
- Event::Mouse(m) => self.handle_mouse_input(*m),
+ Event::Mouse(m) => self.handle_mouse_input(*m, settings.invert),
Event::Paste(d) => self.handle_paste_input(d),
_ => InputAction::Continue,
}
}
- fn handle_mouse_input(&mut self, input: MouseEvent) -> InputAction {
- match input.kind {
- event::MouseEventKind::ScrollDown => {
+ fn handle_mouse_input(&mut self, input: MouseEvent, inverted: bool) -> InputAction {
+ match (input.kind, inverted) {
+ (event::MouseEventKind::ScrollDown, false)
+ | (event::MouseEventKind::ScrollUp, true) => {
self.scroll_down(1);
}
- event::MouseEventKind::ScrollUp => {
+ (event::MouseEventKind::ScrollDown, true)
+ | (event::MouseEventKind::ScrollUp, false) => {
self.scroll_up(1);
}
_ => {}