From d39ad2acded812f4dcd84612b6c69e834fc01924 Mon Sep 17 00:00:00 2001 From: Dhananjay Date: Thu, 25 Jul 2024 06:41:02 +0530 Subject: [PATCH] fix(edit action): update jumplist when moving in same file (#3205) C-o behaves unintuitively when same file is selected at different position. --- lua/telescope/actions/set.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua index c9b91f4..b37c1e8 100644 --- a/lua/telescope/actions/set.lua +++ b/lua/telescope/actions/set.lua @@ -220,6 +220,9 @@ action_set.edit = function(prompt_bufnr, command) end if row and col then + if vim.api.nvim_buf_get_name(0) == filename then + vim.cmd [[normal! m']] + end local ok, err_msg = pcall(a.nvim_win_set_cursor, 0, { row, col }) if not ok then log.debug("Failed to move to cursor:", err_msg, row, col)