feat: add config option "telescope.reset_prompt_after_deletion"
User can decide whether to reset the prompt or not, after deleting a sessionmain
parent
e39170f571
commit
53a39a0447
|
|
@ -143,6 +143,7 @@ require("persisted").setup({
|
||||||
telescope = { -- options for the telescope extension
|
telescope = { -- options for the telescope extension
|
||||||
before_source = nil, -- function to run before the session is sourced via telescope
|
before_source = nil, -- function to run before the session is sourced via telescope
|
||||||
after_source = nil, -- function to run after the session is sourced via telescope
|
after_source = nil, -- function to run after the session is sourced via telescope
|
||||||
|
reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ local defaults = {
|
||||||
telescope = { -- options for the telescope extension
|
telescope = { -- options for the telescope extension
|
||||||
before_source = nil, -- function to run before the session is sourced via telescope
|
before_source = nil, -- function to run before the session is sourced via telescope
|
||||||
after_source = nil, -- function to run after the session is sourced via telescope
|
after_source = nil, -- function to run after the session is sourced via telescope
|
||||||
|
reset_prompt_after_deletion = true, -- whether to reset prompt after session deleted
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ local function search_sessions(opts)
|
||||||
attach_mappings = function(prompt_bufnr, map)
|
attach_mappings = function(prompt_bufnr, map)
|
||||||
local refresh_sessions = function()
|
local refresh_sessions = function()
|
||||||
local picker = action_state.get_current_picker(prompt_bufnr)
|
local picker = action_state.get_current_picker(prompt_bufnr)
|
||||||
picker:refresh(_finders.session_finder(require("persisted").list()), { reset_prompt = true })
|
picker:refresh(_finders.session_finder(require("persisted").list()), {
|
||||||
|
reset_prompt = config.telescope.reset_prompt_after_deletion
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
_actions.delete_session:enhance({ post = refresh_sessions })
|
_actions.delete_session:enhance({ post = refresh_sessions })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue