selection quit when we jump to update outside of viewport

This commit is contained in:
rhodes-b
2024-12-24 17:01:15 -06:00
parent 44e1c0f397
commit 616709ae2c

View File

@ -3417,6 +3417,12 @@ pub fn cursorPosCallback(
return;
};
// handle the case where we go outside of the viewport
// which is represented by a negative position for both x and y
if (pos.x < 0 and pos.y < 0) {
return;
}
// Handle dragging depending on click count
switch (self.mouse.left_click_count) {
1 => try self.dragLeftClickSingle(pin, pos.x),
@ -3548,7 +3554,6 @@ fn dragLeftClickSingle(
// ALWAYS selected the current char, but we must move the cursor
// left of the xboundary.
// - Inverted logic for forwards selections.
//
// Our clicking point
const click_pin = self.mouse.left_click_pin.?.*;