We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 71af1bb + 407c1c2 commit 10f7f0bCopy full SHA for 10f7f0b
1 file changed
lua/modules/configs/tool/toggleterm.lua
@@ -8,11 +8,20 @@ return function()
8
return vim.o.columns * 0.40
9
end
10
end,
11
- on_open = function()
+ on_open = function(term)
12
-- Prevent infinite calls from freezing neovim.
13
-- Only set these options specific to this terminal buffer.
14
vim.api.nvim_set_option_value("foldmethod", "manual", { scope = "local" })
15
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
25
26
highlights = {
27
Normal = {
0 commit comments