diff options
author | opalmay <[email protected]> | 2022-12-20 17:58:43 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2022-12-20 17:58:43 +0200 |
commit | c70a094314d890575641e9166a535b5c257951f2 (patch) | |
tree | ec6dc449bd6502ec9eaeed6dce104bfc980bfd48 /lua/lvim | |
parent | b661efb3179e9ee7c44c5b2f885f5a7e837ea19d (diff) |
feat: don't prompt smart quit when buffer open in another window (#3636)
Diffstat (limited to 'lua/lvim')
-rw-r--r-- | lua/lvim/utils/functions.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/lvim/utils/functions.lua b/lua/lvim/utils/functions.lua index 1cb8ec8e..efc4b5eb 100644 --- a/lua/lvim/utils/functions.lua +++ b/lua/lvim/utils/functions.lua @@ -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) |