瀏覽代碼

fix: discard invalid choice when closing buffers (#3488)

Dev 2 年之前
父節點
當前提交
a8957a9d36
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lua/lvim/core/bufferline.lua

+ 1 - 1
lua/lvim/core/bufferline.lua

@@ -194,7 +194,7 @@ function M.buf_kill(kill_command, bufnr, force)
       vim.ui.input({
         prompt = string.format([[%s. Close it anyway? [y]es or [n]o (default: no): ]], warning),
       }, function(choice)
-        if choice:match "ye?s?" then force = true end
+        if choice ~= nil and choice:match "ye?s?" then force = true end
       end)
       if not force then return end
     end