feat: don't prompt smart quit when buffer open in another window (#3636)

This commit is contained in:
opalmay 2022-12-20 17:58:43 +02:00 committed by GitHub
parent b661efb317
commit c70a094314
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,8 +2,9 @@ local M = {}
function M.smart_quit()
local bufnr = vim.api.nvim_get_current_buf()
local buf_windows = vim.call("win_findbuf", bufnr)
local modified = vim.api.nvim_buf_get_option(bufnr, "modified")
if modified then
if modified and #buf_windows == 1 then
vim.ui.input({
prompt = "You have unsaved changes. Quit anyway? (y/n) ",
}, function(input)