From 5db076c7ccfef6732516074252ac4b21b12fc629 Mon Sep 17 00:00:00 2001 From: Aayush Ojha Date: Fri, 6 Oct 2023 05:44:50 -0700 Subject: fix(lua): vim.region on linewise selection #25467 fixes #18155 --- runtime/lua/vim/_editor.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index 1ba7d6163d..bbe93bfbc8 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -548,6 +548,9 @@ function vim.region(bufnr, pos1, pos2, regtype, inclusive) else c2 = #bufline + 1 end + elseif regtype == 'V' then -- linewise selection, always return whole line + c1 = 0 + c2 = -1 else c1 = (l == pos1[1]) and pos1[2] or 0 c2 = (l == pos2[1]) and (pos2[2] + (inclusive and 1 or 0)) or -1 -- cgit