From aa47539518a13856fc2c3c20b50c3d0f4debbe06 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Wed, 27 Dec 2023 08:32:26 -0800 Subject: [PATCH] Using glyph end instead of incrementing start Closes #112 This removes the last manual byte change I can find. While what the user reported was that this was causing incorrect selection, using the arrow keys when in this situation could lead to a panic, because the offset was not a valid character offset. --- src/widgets/input.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/input.rs b/src/widgets/input.rs index f888782..e92f86b 100644 --- a/src/widgets/input.rs +++ b/src/widgets/input.rs @@ -872,9 +872,9 @@ where && relative.y <= cache.measured.line_height { return if relative.x > rect.size.width / 2 { - if glyph.info.start + 1 < cache.bytes { + if glyph.info.end < cache.bytes { Cursor { - offset: glyph.info.start + 1, + offset: glyph.info.end, affinity: Affinity::Before, } } else {