aboutsummaryrefslogtreecommitdiff
path: root/view.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-04-08 22:11:57 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-04-09 11:28:06 +0200
commit4f15fee811d2645bf810a475d4272f83c30608d6 (patch)
treee61902723c42378b78b43e42bf55f37ec216d702 /view.c
parent6a6bc5bb4c1b5be36b342266d0f74ec4a2843b00 (diff)
downloadvis-4f15fee811d2645bf810a475d4272f83c30608d6.tar.gz
vis-4f15fee811d2645bf810a475d4272f83c30608d6.tar.xz
vis: remove handling of \r\n line endings
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
Diffstat (limited to 'view.c')
-rw-r--r--view.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/view.c b/view.c
index 49b0d4f..7e893ff 100644
--- a/view.c
+++ b/view.c
@@ -382,11 +382,6 @@ void view_draw(View *view) {
cell.width = 1;
}
- if (cur[0] == '\r' && rem > 1 && cur[1] == '\n') {
- /* convert views style newline \r\n into a single char with len = 2 */
- cell = (Cell){ .data = "\n", .len = 2, .width = 1 };
- }
-
if (cell.width == 0 && prev_cell.len + cell.len < sizeof(cell.data)) {
prev_cell.len += cell.len;
strcat(prev_cell.data, cell.data);
@@ -593,16 +588,12 @@ bool view_viewport_up(View *view, int n) {
/* skip newlines immediately before display area */
if (c == '\n' && text_iterator_byte_prev(&it, &c))
off++;
- if (c == '\r' && text_iterator_byte_prev(&it, &c))
- off++;
do {
if (c == '\n' && --n == 0)
break;
if (++off > max)
break;
} while (text_iterator_byte_prev(&it, &c));
- if (c == '\r')
- off++;
view->start -= MIN(view->start, off);
view_draw(view);
return true;