From 7ee115fac249d0c999caa13e92aaefc0e48a507b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Cuervo?= Date: Tue, 12 Dec 2023 16:39:11 -0500 Subject: Bounds check right arrow key --- virtual-programs/editor.folk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'virtual-programs') diff --git a/virtual-programs/editor.folk b/virtual-programs/editor.folk index d1616d65..65d1df2c 100644 --- a/virtual-programs/editor.folk +++ b/virtual-programs/editor.folk @@ -248,8 +248,11 @@ When /page/ is a keyboard with path /kbPath/ { } RIGHT { set currentLineLength [getCurrentLineLength $code $cursor] - # TODO: Check if the cursor is at the end of the line, if so cap it - Claim the $kbPath cursor is [updateCursor $cursor {x 1}] + if {[lindex $cursor 0] == $currentLineLength} { + Claim the $kbPath cursor is $cursor + } else { + Claim the $kbPath cursor is [updateCursor $cursor {x 1}] + } } LEFT { Claim the $kbPath cursor is [updateCursor $cursor {x -1}] } BACKSPACE { -- cgit v1.2.3