about summary refs log tree commit diff stats
path: root/edit
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2017-06-09 23:42:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2017-06-09 23:42:58 -0700
commitf0f077661c1f5d587602343a1a0bc82f0c99cf59 (patch)
tree0a224a22b1a50ce9ee44f03e6443623dce17a4fc /edit
parentbd5d3936ec77e0ec42d6f9d99d377d807e9892f8 (diff)
downloadmu-f0f077661c1f5d587602343a1a0bc82f0c99cf59.tar.gz
3904
Standardize functions to put the main object being modified first.
Diffstat (limited to 'edit')
-rw-r--r--edit/002-typing.mu8
-rw-r--r--edit/004-programming-environment.mu4
2 files changed, 6 insertions, 6 deletions
diff --git a/edit/002-typing.mu b/edit/002-typing.mu
index 7c385b6f..c6c8edd5 100644
--- a/edit/002-typing.mu
+++ b/edit/002-typing.mu
@@ -30,7 +30,7 @@ def editor-event-loop screen:&:screen, console:&:console, editor:&:editor -> scr
     t:touch-event, is-touch?:bool <- maybe-convert e, touch:variant
     {
       break-unless is-touch?
-      move-cursor-in-editor screen, editor, t
+      move-cursor editor, screen, t
       loop +next-event
     }
     # keyboard events
@@ -47,7 +47,7 @@ def editor-event-loop screen:&:screen, console:&:console, editor:&:editor -> scr
 ]
 
 # process click, return if it was on current editor
-def move-cursor-in-editor screen:&:screen, editor:&:editor, t:touch-event -> in-focus?:bool, editor:&:editor [
+def move-cursor editor:&:editor, screen:&:screen, t:touch-event -> in-focus?:bool, editor:&:editor [
   local-scope
   load-ingredients
   return-unless editor, 0/false
@@ -62,7 +62,7 @@ def move-cursor-in-editor screen:&:screen, editor:&:editor, t:touch-event -> in-
   return-if too-far-right?, 0/false
   # position cursor
   <move-cursor-begin>
-  editor <- snap-cursor screen, editor, click-row, click-column
+  editor <- snap-cursor editor, screen, click-row, click-column
   undo-coalesce-tag:num <- copy 0/never
   <move-cursor-end>
   # gain focus
@@ -72,7 +72,7 @@ def move-cursor-in-editor screen:&:screen, editor:&:editor, t:touch-event -> in-
 # Variant of 'render' that only moves the cursor (coordinates and
 # before-cursor). If it's past the end of a line, it 'slides' it left. If it's
 # past the last line it positions at end of last line.
-def snap-cursor screen:&:screen, editor:&:editor, target-row:num, target-column:num -> editor:&:editor [
+def snap-cursor editor:&:editor, screen:&:screen, target-row:num, target-column:num -> editor:&:editor [
   local-scope
   load-ingredients
   return-unless editor
diff --git a/edit/004-programming-environment.mu b/edit/004-programming-environment.mu
index f0c8501e..71e72e46 100644
--- a/edit/004-programming-environment.mu
+++ b/edit/004-programming-environment.mu
@@ -80,8 +80,8 @@ def event-loop screen:&:screen, console:&:console, env:&:environment, resources:
       # later exceptions for non-editor touches will go here
       <global-touch>
       # send to both editors
-      _ <- move-cursor-in-editor screen, recipes, t
-      sandbox-in-focus?:bool <- move-cursor-in-editor screen, current-sandbox, t
+      _ <- move-cursor recipes, screen, t
+      sandbox-in-focus?:bool <- move-cursor current-sandbox, screen, t
       *env <- put *env, sandbox-in-focus?:offset, sandbox-in-focus?
       screen <- update-cursor screen, recipes, current-sandbox, sandbox-in-focus?, env
       loop +next-event