core: if click-to-move is done, stop mouse processing

pull/1137/head
Mitchell Hashimoto 2023-12-20 21:41:49 -08:00
parent 3f9c42fd67
commit 3776b8a777
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 4 additions and 0 deletions

View File

@ -1989,6 +1989,7 @@ pub fn mouseButtonCallback(
self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock();
try self.clickMoveCursor(self.mouse.left_click_point);
return;
}
// For left button clicks we always record some information for
@ -2089,6 +2090,9 @@ pub fn mouseButtonCallback(
}
}
/// Performs the "click-to-move" logic to move the cursor to the given
/// screen point if possible. This works by converting the path to the
/// given point into a series of arrow key inputs.
fn clickMoveCursor(self: *Surface, to: terminal.point.ScreenPoint) !void {
const t = &self.io.terminal;