Skip to content

Commit a39327d

Browse files
committed
fix: address luacheck warnings
1 parent 4378c70 commit a39327d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lua/claudecode/terminal.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ end
150150
-- @param effective_term_config table Configuration for split_side and split_width_percentage.
151151
-- @return boolean True if successful, false otherwise.
152152
local function open_fallback_terminal(cmd_string, env_table, effective_term_config)
153-
if is_fallback_terminal_valid() then -- Should not happen if called correctly, but as a safeguard
153+
if is_fallback_terminal_window_valid() then -- Should not happen if called correctly, but as a safeguard
154154
vim.api.nvim_set_current_win(managed_fallback_terminal_winid)
155155
vim.cmd("startinsert")
156156
return true
@@ -240,7 +240,7 @@ end
240240
--- Closes the managed fallback terminal if it's open and valid.
241241
-- @local
242242
local function close_fallback_terminal()
243-
if is_fallback_terminal_valid() then
243+
if is_fallback_terminal_window_valid() then
244244
-- Closing the window should trigger on_exit of the job if the process is still running,
245245
-- which then calls cleanup_fallback_terminal_state.
246246
-- If the job already exited, on_exit would have cleaned up.
@@ -253,7 +253,7 @@ end
253253
--- Focuses the managed fallback terminal if it's open and valid.
254254
-- @local
255255
local function focus_fallback_terminal()
256-
if is_fallback_terminal_valid() then
256+
if is_fallback_terminal_window_valid() then
257257
vim.api.nvim_set_current_win(managed_fallback_terminal_winid)
258258
vim.cmd("startinsert")
259259
end
@@ -410,7 +410,9 @@ function M.close()
410410
-- managed_snacks_terminal will be set to nil by the on_close callback
411411
end
412412
elseif provider == "native" then
413-
close_fallback_terminal()
413+
if is_fallback_terminal_window_valid() then
414+
close_fallback_terminal()
415+
end
414416
end
415417
end
416418

@@ -505,7 +507,7 @@ function M.get_active_terminal_bufnr()
505507
end
506508
end
507509

508-
if is_fallback_terminal_valid() then
510+
if is_fallback_terminal_buffer_valid() then
509511
return managed_fallback_terminal_bufnr
510512
end
511513

0 commit comments

Comments
 (0)