aboutsummaryrefslogtreecommitdiffstats
path: root/examples/notes.aup
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-09-26 11:01:21 +0100
committereunhhu <[email protected]>2026-09-26 11:01:21 +0100
commitacbd39e3e838fe49b17e32fe254af9ea12b4f81b (patch)
tree64a91b85cd4249f52e6f1ab5faae0142627c599a /examples/notes.aup
parent91332801ff2334cd887df3971f944b60bebf729c (diff)
downloadaup-acbd39e3e838fe49b17e32fe254af9ea12b4f81b.tar.gz
aup-acbd39e3e838fe49b17e32fe254af9ea12b4f81b.zip
Declare marks: cursors that stay before inserted text
`state from: mark in note` is a cursor that stays before text inserted at its position; `cursor in` goes after it, as a caret does. Everything a cursor takes, a mark takes too. The notes example's mark is now one, and its reference model agrees: typing at the mark leaves it in place.
Diffstat (limited to 'examples/notes.aup')
-rw-r--r--examples/notes.aup5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/notes.aup b/examples/notes.aup
index fdc91b8..214b617 100644
--- a/examples/notes.aup
+++ b/examples/notes.aup
@@ -1,10 +1,11 @@
# A small text editor. The runtime owns the text: typing inserts at the
# cursor, the cursor and the mark always sit between characters and follow
-# edits, and a failed event would leave everything as it was.
+# edits (text typed at the mark goes after it: the mark stays), and a failed
+# event would leave everything as it was.
state title: text = "메모"
state note: text = ""
state at: cursor in note
-state mark: cursor in note
+state mark: mark in note
input typed = text
input left = key ArrowLeft