From 031322a7c3dc47828511c40c95bc325c39e42ca3 Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Sun, 9 Apr 2023 04:09:42 -0400 Subject: [PATCH] fix(action): grep_string select_default with nil column (#2447) --- lua/telescope/actions/set.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index c479324..bf555fb 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -169,9 +169,15 @@ 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 + local pos = vim.api.nvim_win_get_cursor(0) + if col == nil then + if row == pos[1] then + col = pos[2] + 1 + elseif row == nil then + row, col = pos[1], pos[2] + 1 + else + col = 1 + end end if row and col then