From 4f15fee811d2645bf810a475d4272f83c30608d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 8 Apr 2017 22:11:57 +0200 Subject: vis: remove handling of \r\n line endings Use something like dos2unix(1) and unix2dos(1), if you need to edit such files. --- vis-operators.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vis-operators.c') diff --git a/vis-operators.c b/vis-operators.c index 446260d..1ef32c3 100644 --- a/vis-operators.c +++ b/vis-operators.c @@ -48,7 +48,7 @@ static size_t op_put(Vis *vis, Text *txt, OperatorContext *c) { case VIS_OP_PUT_AFTER_END: if (c->reg->linewise && !sel_linewise) pos = text_line_next(txt, pos); - else if (!sel && text_byte_get(txt, pos, &b) && b != '\r' && b != '\n') + else if (!sel && text_byte_get(txt, pos, &b) && b != '\n') pos = text_char_next(txt, pos); break; case VIS_OP_PUT_BEFORE: @@ -218,7 +218,7 @@ static size_t op_join(Vis *vis, Text *txt, OperatorContext *c) { text_delete(txt, pos, end - pos); char prev, next; if (text_byte_get(txt, pos-1, &prev) && !isspace((unsigned char)prev) && - text_byte_get(txt, pos, &next) && next != '\r' && next != '\n') + text_byte_get(txt, pos, &next) && next != '\n') text_insert(txt, pos, c->arg->s, len); if (mark == EMARK) mark = text_mark_set(txt, pos); -- cgit v1.2.3