diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index 6e12907..c479324 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -110,7 +110,7 @@ action_set.edit = function(prompt_bufnr, command) -- TODO: Check for off-by-one row = entry.row or entry.lnum - col = vim.F.if_nil(entry.col, 1) + col = entry.col elseif not entry.bufnr then -- TODO: Might want to remove this and force people -- to put stuff into `filename` @@ -169,6 +169,11 @@ action_set.edit = function(prompt_bufnr, command) end end + if row == nil or col == nil then + local pos = vim.api.nvim_win_get_cursor(0) + row, col = pos[1], pos[2] + 1 + end + if row and col then local ok, err_msg = pcall(a.nvim_win_set_cursor, 0, { row, col }) if not ok then