mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
This commit is contained in:
parent
735f4d8c9d
commit
4ff08f1c4d
1 changed files with 15 additions and 2 deletions
|
@ -986,9 +986,22 @@ function M.setup()
|
|||
return
|
||||
end
|
||||
|
||||
if vim.bo[buf].modified then
|
||||
M.status.reason = "buffer is modified"
|
||||
return
|
||||
end
|
||||
|
||||
local uis = vim.api.nvim_list_uis()
|
||||
|
||||
-- check for headless
|
||||
if #uis == 0 then
|
||||
M.status.reason = "headless"
|
||||
return
|
||||
end
|
||||
|
||||
-- don't open the dashboard if input is piped
|
||||
if uv.guess_handle(3) == "pipe" then
|
||||
M.status.reason = "stdin is a pipe"
|
||||
if uis[1].stdin_tty == false then
|
||||
M.status.reason = "stdin is not a tty"
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue