summaryrefslogtreecommitdiff
path: root/lua/telescope/actions
diff options
context:
space:
mode:
authorJoshua Cao <cao.joshua@yahoo.com>2022-04-08 11:09:58 -0700
committerGitHub <noreply@github.com>2022-04-08 20:09:58 +0200
commit8af0d384d21104be3cb055494aab9a6f86d94067 (patch)
tree09ce320b7c7d16203ef032ba49345bfd9ac1ab66 /lua/telescope/actions
parent317371d37c21216c7042fc7b2e8bf0aeb601bf59 (diff)
fix: save position into jumplist before 'edit' action (#1234)
currently enabled for some builtins. You can manually enable it by adding `push_cursor_on_edit = true` to the builtin options. But feel free to open a PR if you find a builtin that needs this option enabled.
Diffstat (limited to 'lua/telescope/actions')
-rw-r--r--lua/telescope/actions/set.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/lua/telescope/actions/set.lua b/lua/telescope/actions/set.lua
index 4e35d10..b98ad7e 100644
--- a/lua/telescope/actions/set.lua
+++ b/lua/telescope/actions/set.lua
@@ -129,8 +129,13 @@ action_set.edit = function(prompt_bufnr, command)
local entry_bufnr = entry.bufnr
+ local picker = action_state.get_current_picker(prompt_bufnr)
require("telescope.actions").close(prompt_bufnr)
+ if picker.push_cursor_on_edit then
+ vim.cmd "normal! m'"
+ end
+
if entry_bufnr then
if not vim.api.nvim_buf_get_option(entry_bufnr, "buflisted") then
vim.api.nvim_buf_set_option(entry_bufnr, "buflisted", true)