aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-02-25 19:58:15 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-02-25 19:58:15 +0100
commite165a615fc0f2964bd8de37d3ed4973cddeda83b (patch)
tree306b4119011f7d84cec25a5a1003181298152d94
parent28a9ce8ad8a18eaabca7cc0674624d32318fb3d8 (diff)
downloadvis-e165a615fc0f2964bd8de37d3ed4973cddeda83b.tar.gz
vis-e165a615fc0f2964bd8de37d3ed4973cddeda83b.tar.xz
vis: fix $ motion for lines containing \r
-rw-r--r--text-motions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text-motions.c b/text-motions.c
index ae8944f..f590f33 100644
--- 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;
}