Skip to content

Commit 418562e

Browse files
authored
refactor(ui): remove redundant spinner checks in chat (#1404)
Simplifies Chat:start and Chat:finish by removing unnecessary checks for self.spinner. Assumes spinner is always present, streamlining the code and reducing conditional branches. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
1 parent 1041ad0 commit 418562e

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

lua/CopilotChat/ui/chat.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -464,19 +464,12 @@ function Chat:start()
464464
utils.return_to_normal_mode()
465465
end
466466

467-
if self.spinner then
468-
self.spinner:start()
469-
end
470-
467+
self.spinner:start()
471468
vim.bo[self.bufnr].modifiable = false
472469
end
473470

474471
--- Finish writing to the chat window.
475472
function Chat:finish()
476-
if not self.spinner then
477-
return
478-
end
479-
480473
self.spinner:finish()
481474
vim.bo[self.bufnr].modifiable = true
482475
if self.config.auto_insert_mode and self:focused() then

0 commit comments

Comments
 (0)