diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-22 14:36:20 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-22 18:11:04 +0100 |
| commit | c6d76158b597d6c9bcfe222129d2897fececc45f (patch) | |
| tree | 6aae2f997b019d51dc8916b8c08007e28d91ef11 /text.c | |
| parent | 0f15c4af6c68edb3fa8e3331260e1da43121827f (diff) | |
| download | vis-c6d76158b597d6c9bcfe222129d2897fececc45f.tar.gz vis-c6d76158b597d6c9bcfe222129d2897fececc45f.tar.xz | |
text: introduce EMARK to denote an invalid mark
Technically this macro name is in the reserved namespace of errno.h.
The same is true for EPOS. Maybe we should rename them at some point,
but for now the short names are convenient.
Fix #443
Close #444
Diffstat (limited to 'text.c')
| -rw-r--r-- | text.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1634,14 +1634,14 @@ Mark text_mark_set(Text *txt, size_t pos) { return (Mark)&txt->end; Location loc = piece_get_extern(txt, pos); if (!loc.piece) - return (Mark)NULL; + return EMARK; return (Mark)(loc.piece->data + loc.off); } size_t text_mark_get(Text *txt, Mark mark) { size_t cur = 0; - if (!mark) + if (mark == EMARK) return EPOS; if (mark == (Mark)&txt->begin) return 0; |
