diff options
| author | eunhhu <[email protected]> | 2026-09-26 11:01:21 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-26 11:01:21 +0100 |
| commit | 6e50736c576b93c09345dc63488bbb95e9203c13 (patch) | |
| tree | 6c267b464f141edcaa340dbe24604069efda82d1 /docs | |
| parent | b230b70252f09cf3425a8b4b959b3dfd72075b31 (diff) | |
| download | pure-6e50736c576b93c09345dc63488bbb95e9203c13.tar.gz pure-6e50736c576b93c09345dc63488bbb95e9203c13.zip | |
Let a cursor stay before text inserted at it (a mark)
Text inserted at a cursor's position pushed every cursor there behind
it. That suits a caret, not a remembered position: a mark, a selection's
start or a bookmark should stay before the new text. A cursor state's
reserved word in the module now carries a flag: 1 makes it a mark, which
stays where text is inserted at it and otherwise follows edits as any
cursor does. The flag is refused on other states and other values;
existing modules, with 0 there, keep their meaning.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/design/008-module-format.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/design/008-module-format.md b/docs/design/008-module-format.md index 6d1b32e..5474541 100644 --- a/docs/design/008-module-format.md +++ b/docs/design/008-module-format.md @@ -25,7 +25,7 @@ v5는 값을 가진 채 합류하는 분기(조건식)와, 리스트 항목마� | 16 | u32 명령 수, u32 문자열 바이트 수 | | 24 | u16 필드, u16 컬렉션, u16 상수, u16 레코드 | | 32 | u32 상수 블롭 바이트 수, u16 레코드 필드, u16 0 | -| 40 | 상태 × 16 B: u32 이름, u32 타입(0 수, 1 text, 2 커서, 3 리스트, 4 인덱스), 8 B 값: 수는 f64 초기값, text는 u32 초기 상수, 커서는 u32 대상 text 상태, 리스트는 u32 레코드, 인덱스는 u32 대상 리스트 상태 | +| 40 | 상태 × 16 B: u32 이름, u32 타입(0 수, 1 text, 2 커서, 3 리스트, 4 인덱스), 8 B 값: 수는 f64 초기값, text는 u32 초기 상수, 커서는 u32 대상 text 상태와 u32 플래그(1이면 마크: 그 자리에 넣은 글 앞에 남는다), 리스트는 u32 레코드, 인덱스는 u32 대상 리스트 상태 | | | 컬렉션 × 12 B: u32 이름, u32 1(바이트), u32 1(키별) | | | 입력 × 16 B: u32 이름, u8 종류(1 키, 2 메시지, 3 text), u8 키별 여부, u16 0, u32 키 이름(키 입력) 또는 0, u16 첫 필드, u16 필드 수 | | | 필드 × 8 B: u32 이름, u32 타입(1 u32le, 2 바이트 꼬리) | @@ -127,7 +127,7 @@ v5는 값을 가진 채 합류하는 분기(조건식)와, 리스트 항목마� `PureApp`은 모듈 참조, 상태 값, text 상태 draft, 리스트, 열린 이벤트 하나를 가진다(3,128 B, `PureModule`은 상수 블롭을 포함해 28,600 B). text 상태는 저장소 파일이 없는 draft라 1 MiB 텍스트도 조각 트리로 편집한다. 커서는 바이트 -위치이며 항상 글자 경계에 있다. 넣기는 그 위치 이후의 커서를 뒤로(삽입 위치의 커서 포함) 밀고, 지우기는 범위 +위치이며 항상 글자 경계에 있다. 넣기는 그 위치 이후의 커서를 뒤로(삽입 위치의 커서 포함, 마크는 제자리) 밀고, 지우기는 범위 안의 커서를 범위 처음으로 모은다. 모든 이벤트에서 text draft를 잡아 두고, 실패하면 이벤트 전 버전으로 돌린다. 리스트는 런타임이 소유하는 항목 배열이고, 항목은 필드마다 수 또는 text 바이트를 가진다(최대 65,536 항목). 인덱스는 |
