From b9d70d03550b33b40212c98251733e11a6b33ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 4 May 2016 09:34:50 +0200 Subject: vis: make j and k a linewise inclusive motion They behave like an inclusive motion, but only if they are also linewise (which they are by default). This should make `yjp` and `ykp` yank both the current and the next/previous line when the cursor is at the start of a line. See also 532f52e9e52b98dc5749396f7353295418e0227a and #237 --- vis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c3077a4..7c1ab78 100644 --- a/vis.c +++ b/vis.c @@ -542,7 +542,8 @@ void action_do(Vis *vis, Action *a) { window_jumplist_add(win, pos); else window_jumplist_invalidate(win); - } else if (a->movement->type & INCLUSIVE) { + } else if (a->movement->type & INCLUSIVE || + (linewise && a->movement->type & LINEWISE_INCLUSIVE)) { c.range.end = text_char_next(txt, c.range.end); } } else if (a->textobj) { -- cgit v1.2.3