vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit cfb8f4c8cefab2b5f089f1c621b602f9b9277849
parent d6e0dd4f71374f16c3edac30a778b2ded3b14db0
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 27 Oct 2014 16:21:46 +0100

Also join lines if cursor is at beginning of a line

Diffstat:
Mvis.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vis.c b/vis.c @@ -642,8 +642,9 @@ static void op_repeat_insert(OperatorContext *c) { static void op_join(OperatorContext *c) { Text *txt = vis->win->text; size_t pos = text_line_begin(txt, c->range.end), prev_pos; - /* if range ends at the begin of a line, skip line break */ - if (pos == c->range.end) + Filerange sel = window_selection_get(vis->win->win); + /* if a selection ends at the begin of a line, skip line break */ + if (pos == c->range.end && text_range_valid(&sel)) pos = text_line_prev(txt, pos); do {