vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 446246abd036f4556485349a76ac5a0def851075 parent 29f8ba9dd33d7d510254abffdbdea678171e880a Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 8 Feb 2017 15:53:39 +0100 text: remove special case for marks at start of file Unlike EOF address 0 needs no special treatment. Diffstat:
| M | text.c | | | 4 | ---- |
1 file changed, 0 insertions(+), 4 deletions(-)
diff --git a/text.c b/text.c @@ -1628,8 +1628,6 @@ size_t text_lineno_by_pos(Text *txt, size_t pos) { } Mark text_mark_set(Text *txt, size_t pos) { - if (pos == 0) - return (Mark)&txt->begin; if (pos == txt->size) return (Mark)&txt->end; Location loc = piece_get_extern(txt, pos); @@ -1643,8 +1641,6 @@ size_t text_mark_get(Text *txt, Mark mark) { if (mark == EMARK) return EPOS; - if (mark == (Mark)&txt->begin) - return 0; if (mark == (Mark)&txt->end) return txt->size;