diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-10-27 16:21:46 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-10-27 16:21:46 +0100 |
| commit | add639d3be1e2200926bf5257f39ae972c503cc9 (patch) | |
| tree | 603958a26d8ab5be0b88e2fadd9587441143a4db /vis.c | |
| parent | 145fec60076dd7255ff2185e667796c7c47e2edf (diff) | |
| download | vis-add639d3be1e2200926bf5257f39ae972c503cc9.tar.gz vis-add639d3be1e2200926bf5257f39ae972c503cc9.tar.xz | |
Also join lines if cursor is at beginning of a line
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 { |
