Skip to content

Commit bcef380

Browse files
committed
refactor: rename extension
1 parent 2ced676 commit bcef380

5 files changed

Lines changed: 11 additions & 16 deletions

File tree

lua/lib/actions/init.lua

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ function M.open_term(prompt_bufnr, exit_on_action)
100100
term:open()
101101
end
102102
term:focus()
103+
util.start_insert_mode()
103104
return
104105
end
105106

@@ -150,22 +151,16 @@ function M.delete_term(prompt_bufnr, exit_on_action)
150151
-- and causes telescope to exit. See toggleterm's terminal.lua:__handle_exit and ui.lua:close_split.
151152
term.close_on_exit = false
152153

153-
-- Focus the origin window before deleting the buffer to avoid Telescope from closing.
154154
util.focus_on_origin_win()
155155

156-
-- Check if the buffer type is 'terminal', which requires 'force' when deleting.
157156
local force = vim.api.nvim_buf_get_option(selection.bufnr, "buftype") == "terminal"
158157

159-
-- Delete the buffer associated with the terminal.
160158
delete_buffer(selection.bufnr, force)
161159

162-
-- Reset the origin window in the toggleterm UI after deletion.
163160
toggleterm_ui.set_origin_window()
164161

165162
util.focus_on_telescope(prompt_bufnr)
166163

167-
-- Refresh the picker to reflect the changes in the list of terminals.
168-
-- Pass a boolean flag indicating that an item has been deleted
169164
util.refresh_picker(prompt_bufnr, selection, true)
170165
end
171166

lua/telescope/_extensions/toggleterm.lua

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
local telescope = require("telescope")
2+
local open = require("lib.telescope").open
3+
4+
return telescope.register_extension({
5+
exports = {
6+
toggleterm_manager = open,
7+
},
8+
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if not has_telescope then
55
end
66

77
local M = {}
8-
require("telescope").load_extension("toggleterm")
8+
require("telescope").load_extension("toggleterm_manager")
99

1010
M.actions = require("lib.actions")
1111
M.open = require("lib.telescope").open

lua/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local function_name_to_description = {
1414

1515
function M.format_results_title(mappings)
1616
print(vim.inspect(mappings))
17-
local actions = require("telescope-toggleterm").actions
17+
local actions = require("toggleterm-manager").actions
1818
local mapping_descriptions = {}
1919

2020
for mapping, action_tbl in pairs(mappings) do

0 commit comments

Comments
 (0)