File tree Expand file tree Collapse file tree
home/dot_config/exact_nvim/exact_lua/exact_user/exact_config/exact_autocmds Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,17 +14,23 @@ vim.api.nvim_create_autocmd('QuitPre', {
1414 ' filetype' ,
1515 { buf = vim .api .nvim_win_get_buf (w ) }
1616 )
17+
1718 if filetype :match (' snacks_' ) ~= nil then
1819 table.insert (snacks_windows , w )
1920 elseif vim .api .nvim_win_get_config (w ).relative ~= ' ' then
2021 table.insert (floating_windows , w )
2122 end
2223 end
2324
24- if 1 == # windows - # floating_windows - # snacks_windows then
25- -- Should quit, so we close all Snacks windows.
25+ if # windows - # floating_windows - # snacks_windows == 1 then
26+ for _ , picker in ipairs (require (' snacks' ).picker .get ()) do
27+ picker :close ()
28+ end
29+
2630 for _ , w in ipairs (snacks_windows ) do
27- vim .api .nvim_win_close (w , true )
31+ if vim .api .nvim_win_is_valid (w ) then
32+ vim .api .nvim_win_close (w , true )
33+ end
2834 end
2935 end
3036 end ,
You can’t perform that action at this time.
0 commit comments