mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 16:26:08 +03:00
mouse: handle switch case '0' for left_click_count
A state of '0' if a valid state for the mouse click. I'm unsure *how* we get a 0 within this branch but I was able to reliably trigger it while clicking and dragging. We handle the state explicitly because the `else` prong is `unreachable`. We only handle triple clicks, and in another function we reset to 3 if the count goes above that. Add an assert to confirm this is the case.
This commit is contained in:
@ -2580,8 +2580,10 @@ pub fn cursorPosCallback(
|
||||
// Convert to points
|
||||
const screen_point = pos_vp.toScreen(&self.io.terminal.screen);
|
||||
|
||||
assert(self.mouse.left_click_count <= 3);
|
||||
// Handle dragging depending on click count
|
||||
switch (self.mouse.left_click_count) {
|
||||
0 => {}, // 0 is a valid state but we don't do anything
|
||||
1 => self.dragLeftClickSingle(screen_point, pos.x),
|
||||
2 => self.dragLeftClickDouble(screen_point),
|
||||
3 => self.dragLeftClickTriple(screen_point),
|
||||
|
Reference in New Issue
Block a user