summaryrefslogtreecommitdiff
path: root/lua/warp/util.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/warp/util.lua')
-rw-r--r--lua/warp/util.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/lua/warp/util.lua b/lua/warp/util.lua
index 4f1858e..7030e59 100644
--- a/lua/warp/util.lua
+++ b/lua/warp/util.lua
@@ -29,11 +29,19 @@ M.open_horiz = function()
local horiz_bufnr = vim.api.nvim_create_buf(0, 1)
local line_at = vim.fn.getline(curpos[1])
- local max_width = math.min(width, #line_at + 1)
+
+ local max_width = math.min(
+ width, #line_at + 1 + (vim.o.virtualedit == 'onemore' and 1 or 0))
+ if vim.o.virtualedit == 'all' then
+ max_width = width
+ end
return {
buf = horiz_bufnr,
- panel = M.new_panel(horiz_bufnr, curpos[1] - topline + 1, width_of_garbage - 1,
+ panel = M.new_panel(
+ horiz_bufnr,
+ curpos[1] - topline + 1,
+ width_of_garbage - 1,
max_width + 2, 1)
}
end