Skip to content

Commit 10f7f0b

Browse files
committed
Merge branch '0.11' into refactor/lsp-progress
2 parents 71af1bb + 407c1c2 commit 10f7f0b

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lua/modules/configs/tool/toggleterm.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,20 @@ return function()
88
return vim.o.columns * 0.40
99
end
1010
end,
11-
on_open = function()
11+
on_open = function(term)
1212
-- Prevent infinite calls from freezing neovim.
1313
-- Only set these options specific to this terminal buffer.
1414
vim.api.nvim_set_option_value("foldmethod", "manual", { scope = "local" })
1515
vim.api.nvim_set_option_value("foldexpr", "0", { scope = "local" })
16+
17+
-- Prevent horizontal terminal from obscuring `nvim-tree`.
18+
local api = require("nvim-tree.api")
19+
local tree = require("nvim-tree.view")
20+
if tree.is_visible() and term.direction == "horizontal" then
21+
tree.View.width = vim.fn.winwidth(tree.get_winnr())
22+
api.tree.toggle()
23+
api.tree.toggle(false, true)
24+
end
1625
end,
1726
highlights = {
1827
Normal = {

0 commit comments

Comments
 (0)