diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2021-09-26 12:59:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-26 12:59:24 +0200 |
| commit | 4816a27d7680feed293d21a945c476947af20d29 (patch) | |
| tree | 3460d61de7c382eb7e3bb7b271d6a456af7d5a42 | |
| parent | 41f362006bbe1412ecbe7253d022cceece4e9472 (diff) | |
fix: print error mesage and dont close telescope if nothing is selected (#1285)
| -rw-r--r-- | lua/telescope/builtin/internal.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/telescope/builtin/internal.lua b/lua/telescope/builtin/internal.lua index ef017a2..800c182 100644 --- a/lua/telescope/builtin/internal.lua +++ b/lua/telescope/builtin/internal.lua @@ -583,6 +583,10 @@ internal.help_tags = function(opts) attach_mappings = function(prompt_bufnr) action_set.select:replace(function(_, cmd) local selection = action_state.get_selected_entry() + if selection == nil then + print "[telescope] Nothing currently selected" + return + end actions.close(prompt_bufnr) if cmd == "default" or cmd == "horizontal" then vim.cmd("help " .. selection.value) @@ -615,6 +619,10 @@ internal.man_pages = function(opts) attach_mappings = function(prompt_bufnr) action_set.select:replace(function(_, cmd) local selection = action_state.get_selected_entry() + if selection == nil then + print "[telescope] Nothing currently selected" + return + end local args = selection.section .. " " .. selection.value actions.close(prompt_bufnr) |
