Skip to content

fix(ui): guard close_tab against nil or invalid window#666

Open
ImmanuelHaffner wants to merge 1 commit intoakinsho:mainfrom
ImmanuelHaffner:fix-tab-close-missing-guard
Open

fix(ui): guard close_tab against nil or invalid window#666
ImmanuelHaffner wants to merge 1 commit intoakinsho:mainfrom
ImmanuelHaffner:fix-tab-close-missing-guard

Conversation

@ImmanuelHaffner
Copy link
Copy Markdown

close_tab() calls nvim_win_close(term.window) without checking if term.window is valid, unlike close_split() which already has this guard. This causes "Expected Lua number" errors when the window reference is nil at the time of closing (e.g. when on_exit callbacks clear it before the close flow completes).

Add an early-return guard matching the pattern used by close_split().

`close_tab()` calls `nvim_win_close(term.window)` without checking if
`term.window` is valid, unlike `close_split()` which already has this
guard. This causes "Expected Lua number" errors when the window
reference is `nil` at the time of closing (e.g. when `on_exit` callbacks
clear it before the close flow completes).

Add an early-return guard matching the pattern used by `close_split()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant