diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-04-08 22:11:57 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-04-09 11:28:06 +0200 |
| commit | 4f15fee811d2645bf810a475d4272f83c30608d6 (patch) | |
| tree | e61902723c42378b78b43e42bf55f37ec216d702 /vis-operators.c | |
| parent | 6a6bc5bb4c1b5be36b342266d0f74ec4a2843b00 (diff) | |
| download | vis-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 'vis-operators.c')
| -rw-r--r-- | vis-operators.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
