Skip to content

Commit b8fae24

Browse files
zonghaoyuanclaude
andauthored
fix(edgy): add nil check for toggleterm terminal (#1546)
Fixes #1545 When toggleterm terminal has not been created yet, `require("toggleterm.terminal").get(1)` returns nil, causing an error when trying to access `term.direction`. This commit adds a nil check before accessing the direction property to prevent the error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 4.5 <[email protected]>
1 parent a5f6aed commit b8fae24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/modules/configs/ui/edgy.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ return function()
5959
filter = function(_, win)
6060
local cfg = vim.api.nvim_win_get_config(win)
6161
local term = require("toggleterm.terminal").get(1)
62-
return cfg.relative == "" and term.direction == "horizontal"
62+
return cfg.relative == "" and term and term.direction == "horizontal"
6363
end,
6464
},
6565
{

0 commit comments

Comments
 (0)