diff --git a/crates/edit/src/input.rs b/crates/edit/src/input.rs index a0dfd840844..02d205f13f0 100644 --- a/crates/edit/src/input.rs +++ b/crates/edit/src/input.rs @@ -569,9 +569,9 @@ impl<'input> Stream<'_, '_, 'input> { // I know there's an InputMouseState::Release, but that's because the internals of tui.rs // have leaked into intput.rs. input.rs indicates release by the absence of buttons being // held, which is InputMouseState::None. This makes it more reliable in my opinion. - } else if (WHEEL..WHEEL + 4).contains(&kind) { - let delta = if (kind & 1) != 0 { 3 } else { -3 }; - let idx = if (kind & 2) != 0 { 0 } else { 1 }; + } else if (WHEEL..WHEEL + 0x04).contains(&kind) { + let delta = if (btn & 0x01) != 0 { 1 } else { -1 }; + let idx = if (btn & (0x02 | SHIFT)) != 0 { 0 } else { 1 }; mouse.scroll.as_array()[idx] += delta; mouse.state = InputMouseState::Scroll; } else if (kind & !MOTION) < 3 { diff --git a/crates/edit/src/tui.rs b/crates/edit/src/tui.rs index 0fb7e628bc2..7d30c19f95b 100644 --- a/crates/edit/src/tui.rs +++ b/crates/edit/src/tui.rs @@ -575,7 +575,7 @@ impl Tui { Some(Input::Mouse(mouse)) => { let mut next_state = mouse.state; let next_position = mouse.position; - let next_scroll = mouse.scroll; + let mut next_scroll = mouse.scroll; let mouse_down = self.mouse_state == InputMouseState::None && next_state != InputMouseState::None; let mouse_up = self.mouse_state != InputMouseState::None @@ -621,6 +621,12 @@ impl Tui { if is_scroll { next_state = self.mouse_state; + next_scroll.x *= 7; + next_scroll.y *= 3; + if mouse.modifiers.contains(kbmod::ALT) { + next_scroll.x *= 5; + next_scroll.y *= 5; + } } else if is_drag { self.mouse_is_drag = true; } else if mouse_down {