Skip to content

Commit

Permalink
fixed: terminal window focus issues (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceraxel committed Jul 24, 2023
1 parent 2fc304e commit 2139329
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/cmake-tools/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ function terminal.send_data_to_terminal(buffer_idx, cmd, opts)
if opts and not (opts.focus_on_launch_terminal or opts.focus_on_main_terminal) then
vim.cmd("wincmd p") -- Goes back to previous window: Equivalent to [[ CTRL-W w ]]
elseif opts and opts.start_insert then
vim.api.nvim_set_current_win(opts.win_id)
vim.cmd("startinsert")
else
vim.api.nvim_set_current_win(opts.win_id)
end

-- Focus on the last line in the buffer to keep the scrolling output
Expand Down

0 comments on commit 2139329

Please sign in to comment.