diff options
| author | Andrés Cuervo <andrescuervor@gmail.com> | 2023-12-12 21:39:11 +0000 |
|---|---|---|
| committer | Andrés Cuervo <andrescuervor@gmail.com> | 2023-12-12 21:39:11 +0000 |
| commit | 7ee115fac249d0c999caa13e92aaefc0e48a507b (patch) | |
| tree | b642a4154b202bde3fdfe455e2eafefec8070f1f /virtual-programs | |
| parent | Add precise cursor and smaller editor text (diff) | |
| download | folk-7ee115fac249d0c999caa13e92aaefc0e48a507b.tar.gz folk-7ee115fac249d0c999caa13e92aaefc0e48a507b.zip | |
Bounds check right arrow key
Diffstat (limited to 'virtual-programs')
| -rw-r--r-- | virtual-programs/editor.folk | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |
