Skip to content

Commit

Permalink
fix(terminal): allow resizing hidden terminals
Browse files Browse the repository at this point in the history
fixes #459
  • Loading branch information
akinsho committed Jul 10, 2023
1 parent 2249e97 commit bacbaa7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lua/toggleterm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ end

---@param id number terminal id
local function on_vim_resized(id)
local term = M.get(id)
local term = M.get(id, true)
if not term or not term:is_float() or not term:is_open() then return end
ui.update_float(term)
end
Expand All @@ -150,7 +150,6 @@ end
---Terminal buffer autocommands
---@param term Terminal
local function setup_buffer_autocommands(term)
local conf = config.get()
api.nvim_create_autocmd("TermClose", {
buffer = term.bufnr,
group = AUGROUP,
Expand All @@ -164,7 +163,7 @@ local function setup_buffer_autocommands(term)
})
end

if conf.start_in_insert then
if config.start_in_insert then
-- Avoid entering insert mode when spawning terminal in the background
if term.window == api.nvim_get_current_win() then vim.cmd("startinsert") end
end
Expand Down
2 changes: 1 addition & 1 deletion lua/toggleterm/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function M.set_winbar(term)
if
not config.winbar.enabled
or not term
or term:is_float()
or term:is_float() -- TODO: make this configurable
or fn.exists("+winbar") ~= 1
or not term.window
or not api.nvim_win_is_valid(term.window)
Expand Down

0 comments on commit bacbaa7

Please sign in to comment.