fix: find the closest matching symbol not the largest enclosing symbol

This commit is contained in:
CJ van den Berg 2025-11-18 23:27:59 +01:00
parent 8c0eac80cf
commit db8bd0840f
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -196,8 +196,6 @@ fn find_closest(palette: *Type) ?usize {
var previous: usize = 0;
for (palette.entries.items, 0..) |entry, idx| {
_, _, _, const sel = get_values(entry.cbor);
if (cursor.within(sel))
return idx + 1;
if (cursor.row < sel.begin.row) return previous + 1;
previous = idx;
}