فهرست منبع

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

opalmay 2 سال پیش
والد
کامیت
c70a094314
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      lua/lvim/utils/functions.lua

+ 2 - 1
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)