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 /prototypes/connections/module.h | |
| 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 'prototypes/connections/module.h')
| -rw-r--r-- | prototypes/connections/module.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/prototypes/connections/module.h b/prototypes/connections/module.h index 16b755c..c27f836 100644 --- a/prototypes/connections/module.h +++ b/prototypes/connections/module.h @@ -46,6 +46,9 @@ typedef enum { PURE_FIELD_U32 = 1, PURE_FIELD_BYTES = 2 } PureFieldType; typedef enum { PURE_STATE_NUM = 0, PURE_STATE_TEXT = 1, PURE_STATE_CURSOR = 2, PURE_STATE_LIST = 3, PURE_STATE_INDEX = 4 } PureStateType; +/* A cursor that stays before text inserted at it (a mark); other cursors go + * after it (a caret). */ +enum { PURE_CURSOR_STAYS = 1 }; /* A table view has one row per item of a list; its columns are number or * text views evaluated for one row at a time. */ typedef enum { PURE_VIEW_NUM = 0, PURE_VIEW_TEXT = 1, PURE_VIEW_TABLE = 2 } PureViewType; @@ -80,6 +83,7 @@ typedef struct { char input_keys[PURE_MODULE_INPUTS][PURE_MODULE_NAME]; uint8_t state_type[PURE_MODULE_STATES]; uint16_t state_ref[PURE_MODULE_STATES]; /* text: constant; cursor: text; list: record; index: list */ + uint8_t state_flags[PURE_MODULE_STATES]; /* cursor: PURE_CURSOR_STAYS */ PureInputShape input[PURE_MODULE_INPUTS]; PureField field[PURE_MODULE_FIELDS]; double initial[PURE_MODULE_STATES]; |
