vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit d7175905952408c7ed175115e1b92aafda9eb45e parent b12254420ef83faf9d38d423bec0e165356ed6dd Author: Marc André Tanner <mat@brain-dump.org> Date: Sat, 25 Feb 2017 19:58:15 +0100 vis: fix $ motion for lines containing \r Diffstat:
| M | text-motions.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/text-motions.c b/text-motions.c @@ -162,8 +162,8 @@ size_t text_line_finish(Text *txt, size_t pos) { size_t text_line_end(Text *txt, size_t pos) { char c; Iterator it = text_iterator_get(txt, pos); - while (text_iterator_byte_get(&it, &c) && c != '\r' && c != '\n') - text_iterator_byte_next(&it, NULL); + if (text_iterator_char_get(&it, &c) && c != '\n') + while (text_iterator_char_next(&it, &c) && c != '\n'); return it.pos; }