File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ function M.toggle_term(prompt_bufnr, exit_on_action)
201201 util .refresh_picker (prompt_bufnr , term )
202202end
203203
204- --- Rename a terminal.
204+ --- Rename a terminal. If exit_on_action is true, focus it.
205205--- @param prompt_bufnr number The buffer number of the telescope prompt.
206206--- @param exit_on_action boolean Whether to exit the telescope buffer when the action executes.
207207function M .rename_term (prompt_bufnr , exit_on_action )
@@ -221,6 +221,7 @@ function M.rename_term(prompt_bufnr, exit_on_action)
221221
222222 if exit_on_action then
223223 actions .close (prompt_bufnr )
224+ term :focus ()
224225 else
225226 local current_picker = actions_state .get_current_picker (prompt_bufnr )
226227 local finder , new_row_number = util .create_finder (term .id )
Original file line number Diff line number Diff line change @@ -15,27 +15,14 @@ local function telescope_leave_autocmd(picker)
1515 nested = true ,
1616 once = true ,
1717 callback = function ()
18- local desktopPath = os.getenv (" HOME" ) .. " /Desktop/new.txt"
19- local file , err = io.open (desktopPath , " a" )
20- if not file then
21- print (" Error opening file:" , err )
22- return
23- end
24- file :write (" leave" .. " \n " )
25-
2618 local win_is_valid = vim .api .nvim_win_is_valid (picker .original_win_id )
27- file :write (" picker.original_win_id: " .. picker .original_win_id .. " \n " )
2819 if win_is_valid then
29- file :write (" win_is_valid" .. " \n " )
3020 local picker_orig_win_bufnr = vim .fn .winbufnr (picker .original_win_id )
3121 local buftype = vim .api .nvim_buf_get_option (picker_orig_win_bufnr , " filetype" )
32- file :write (" buftype: " .. buftype .. " \n " )
3322 if buftype == " toggleterm" then
3423 util .start_insert_mode ()
3524 end
3625 end
37- file :write (" \n " )
38- file :close ()
3926 end ,
4027 })
4128end
You can’t perform that action at this time.
0 commit comments