File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,11 @@ function M.setup(windows)
9898end
9999
100100function M .close ()
101- if M . mounted () then
102- --- @cast state. windows { footer_win : integer , footer_buf : integer }
103-
104- pcall (vim .api .nvim_win_close , state . windows .footer_win , true )
105- pcall (vim .api .nvim_buf_delete , state . windows .footer_buf , { force = true })
101+ local windows = state . windows
102+ if windows then
103+ --- @cast windows { footer_win : integer , footer_buf : integer }
104+ pcall (vim .api .nvim_win_close , windows .footer_win , true )
105+ pcall (vim .api .nvim_buf_delete , windows .footer_buf , { force = true })
106106 end
107107
108108 state .unsubscribe (' current_model' , on_change )
@@ -113,7 +113,7 @@ function M.close()
113113end
114114
115115function M .mounted (windows )
116- windows = state .windows
116+ windows = windows or state .windows
117117 return windows
118118 and windows .footer_win
119119 and vim .api .nvim_win_is_valid (windows .footer_win )
You can’t perform that action at this time.
0 commit comments