From fbdc71b86b0d8f5b8b79e936c97d00e3a7cba984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 21 Feb 2016 10:29:55 +0100 Subject: 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 ff57c0b8598a60617983ebe25d34c79a9c6bc511. --- vis-operators.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vis-operators.c b/vis-operators.c index 0f3ae19..2408d07 100644 --- 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) { -- cgit v1.2.3