vis

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

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

commit c4f33698b73e8b3a65e9e16a1b16601e8239bf1f
parent 35cd8e5ab83f6fd71954c1887d940c78d4fc0912
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Sun, 21 Feb 2016 10:29:55 +0100

vis: only move to start of yanked range if it is not line wise

Otherwise this completely breaks the common case of yanking a whole
line with yy. This also means that the beavior in visual line mode
is different than in vim.

Partially reverts 95b489ed74760223e629b13e29b8fc13c2f6db20.

Diffstat:
Mvis-operators.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vis-operators.c b/vis-operators.c @@ -27,7 +27,7 @@ static size_t op_yank(Vis *vis, Text *txt, OperatorContext *c) { register_put(vis, c->reg, txt, &c->range); if (c->reg == &vis->registers[VIS_REG_DEFAULT]) register_put(vis, &vis->registers[VIS_REG_ZERO], txt, &c->range); - return c->range.start; + return c->linewise ? c->pos : c->range.start; } static size_t op_put(Vis *vis, Text *txt, OperatorContext *c) {