feat: position cursor at closest glyph boundary on click when beam cursor is enabled

closes #99
This commit is contained in:
CJ van den Berg 2025-01-03 13:52:47 +01:00
parent 18b0c217fc
commit dd042e2fdd
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
3 changed files with 33 additions and 8 deletions

View file

@ -1119,3 +1119,10 @@ pub fn get_cursor_shape(self: *Self) renderer.CursorShape {
.beam => .beam,
};
}
pub fn is_cursor_beam(self: *Self) bool {
return switch (self.get_cursor_shape()) {
.beam, .beam_blink => true,
else => false,
};
}