about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-08 19:33:51 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-08 19:33:51 -0700
commitd2f2ac59b66c3641c7b50a482cc1b062e406d59f (patch)
treecf0ab1e36d0a84432bcb92bd4a7c36f2bb6a0b84
parent0b56336ba853e0ea03de537b1b7a44dcc52c5086 (diff)
downloadmu-d2f2ac59b66c3641c7b50a482cc1b062e406d59f.tar.gz
.
-rw-r--r--shell/environment.mu37
1 files changed, 17 insertions, 20 deletions
diff --git a/shell/environment.mu b/shell/environment.mu
index 6f7e6d42..f4417625 100644
--- a/shell/environment.mu
+++ b/shell/environment.mu
@@ -222,26 +222,6 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d
     }
     return
   }
-  # ctrl-g: go to a function (or the repl)
-  {
-    compare key, 7/ctrl-g
-    break-if-!=
-    var cursor-in-function-modal-a/eax: (addr boolean) <- get self, cursor-in-function-modal?
-    compare *cursor-in-function-modal-a, 0/false
-    break-if-!=
-    # look for a word to prepopulate the modal
-    var current-word-storage: (stream byte 0x40)
-    var current-word/edi: (addr stream byte) <- address current-word-storage
-    word-at-cursor self, current-word
-    var partial-function-name-ah/eax: (addr handle gap-buffer) <- get self, partial-function-name
-    var partial-function-name/eax: (addr gap-buffer) <- lookup *partial-function-name-ah
-    clear-gap-buffer partial-function-name
-    load-gap-buffer-from-stream partial-function-name, current-word
-    # enable the modal
-    var cursor-in-function-modal-a/eax: (addr boolean) <- get self, cursor-in-function-modal?
-    copy-to *cursor-in-function-modal-a, 1/true
-    return
-  }
   # dispatch to function modal if necessary
   {
     var cursor-in-function-modal-a/eax: (addr boolean) <- get self, cursor-in-function-modal?
@@ -319,6 +299,23 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d
     edit-gap-buffer partial-function-name, key
     return
   }
+  # ctrl-g: go to a function (or the repl)
+  {
+    compare key, 7/ctrl-g
+    break-if-!=
+    # look for a word to prepopulate the modal
+    var current-word-storage: (stream byte 0x40)
+    var current-word/edi: (addr stream byte) <- address current-word-storage
+    word-at-cursor self, current-word
+    var partial-function-name-ah/eax: (addr handle gap-buffer) <- get self, partial-function-name
+    var partial-function-name/eax: (addr gap-buffer) <- lookup *partial-function-name-ah
+    clear-gap-buffer partial-function-name
+    load-gap-buffer-from-stream partial-function-name, current-word
+    # enable the modal
+    var cursor-in-function-modal-a/eax: (addr boolean) <- get self, cursor-in-function-modal?
+    copy-to *cursor-in-function-modal-a, 1/true
+    return
+  }
   # dispatch the key to either sandbox or globals
   {
     var cursor-in-globals-a/eax: (addr boolean) <- get self, cursor-in-globals?