From 28d99f031dcee8c2b9753365fbae49bf0ac1f2a0 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 10 Oct 2020 23:38:38 -0700 Subject: 6999 - tile: move to previous word --- apps/tile/environment.mu | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu index 25f3cc70..193fbc97 100644 --- a/apps/tile/environment.mu +++ b/apps/tile/environment.mu @@ -215,6 +215,21 @@ $process:body: { toggle-cursor-word sandbox break $process:body } + compare key, 0x10 # 16 = ctrl-p + { + break-if-!= + # jump to previous word at same level + var prev-word-ah/edx: (addr handle word) <- get cursor-word, prev + var prev-word/eax: (addr word) <- lookup *prev-word-ah + { + compare prev-word, 0 + break-if-= + copy-object prev-word-ah, cursor-word-ah + cursor-to-end prev-word + var cursor-call-path/eax: (addr handle call-path-element) <- get sandbox, cursor-call-path + decrement-final-element cursor-call-path + } + } # if cursor is within a call, disable editing hotkeys below var cursor-call-path-ah/eax: (addr handle call-path-element) <- get sandbox, cursor-call-path var cursor-call-path/eax: (addr call-path-element) <- lookup *cursor-call-path-ah -- cgit 1.4.1-2-gfad0