fix: ignore spurious click events in Editor

closes #471
This commit is contained in:
CJ van den Berg 2026-01-29 12:39:04 +01:00
parent 721370d1ba
commit 8421f56828
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -2695,6 +2695,7 @@ pub const Editor = struct {
}
pub fn primary_click(self: *Self, y: c_int, x: c_int) !void {
if (y < 0 or x < 0) return;
const root = self.buf_root() catch return;
if (tui.fast_scroll()) {
var at: Cursor = .{};
@ -2718,6 +2719,7 @@ pub const Editor = struct {
}
pub fn primary_double_click(self: *Self, y: c_int, x: c_int) !void {
if (y < 0 or x < 0) return;
const primary = self.get_primary();
const root = self.buf_root() catch return;
primary.disable_selection(root, self.metrics);
@ -2731,6 +2733,7 @@ pub const Editor = struct {
}
pub fn primary_triple_click(self: *Self, y: c_int, x: c_int) !void {
if (y < 0 or x < 0) return;
const primary = self.get_primary();
const root = self.buf_root() catch return;
primary.disable_selection(root, self.metrics);