vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 45469f5756f5cd3eff9279e4fe6775caa671d6a4 parent 00f4fdc60cbbe6d0f24c300d36b7c9d1ecf527d5 Author: Marc André Tanner <mat@brain-dump.org> Date: Sat, 30 Aug 2014 08:54:53 +0200 Add trivial text motions to start and end of file Diffstat:
| M | text-motions.c | | | 8 | ++++++++ |
| M | text-motions.h | | | 3 | +++ |
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/text-motions.c b/text-motions.c @@ -5,6 +5,14 @@ // TODO: consistent usage of iterators either char or byte based where appropriate. +size_t text_begin(Text *txt, size_t pos) { + return 0; +} + +size_t text_end(Text *txt, size_t pos) { + return text_size(txt); +} + size_t text_char_next(Text *txt, size_t pos) { Iterator it = text_iterator_get(txt, pos); text_iterator_char_next(&it, NULL); diff --git a/text-motions.h b/text-motions.h @@ -4,6 +4,9 @@ #include <stddef.h> #include "text.h" +size_t text_begin(Text*, size_t pos); +size_t text_end(Text*, size_t pos); + size_t text_char_next(Text*, size_t pos); size_t text_char_prev(Text*, size_t pos);