From f00168d9e5f2ca226df5e03f003fd41ac7a57d5d Mon Sep 17 00:00:00 2001 From: gbprod Date: Fri, 3 May 2024 09:53:51 +0200 Subject: [PATCH] fix: cusorr pos is incorrect in insert mode at the end of the line Ref: #171 --- lua/yanky/telescope/mapping.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/yanky/telescope/mapping.lua b/lua/yanky/telescope/mapping.lua index a8696c8..1cd31e3 100644 --- a/lua/yanky/telescope/mapping.lua +++ b/lua/yanky/telescope/mapping.lua @@ -23,7 +23,7 @@ function mapping.put(type) vim.schedule(function() if nil ~= cursor_pos then - vim.api.nvim_win_set_cursor(0, { cursor_pos[1], math.max(cursor_pos[2] - 1, 0) }) + vim.api.nvim_win_set_cursor(0, { cursor_pos[1], math.max(cursor_pos[2], 0) }) end picker.actions.put(type, mapping.state.is_visual)(selection.value) end)