From a8957a9d363650aba87392b4a144617d08ca96f7 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 18 Nov 2022 02:28:02 -0600 Subject: fix: discard invalid choice when closing buffers (#3488) --- lua/lvim/core/bufferline.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lvim/core/bufferline.lua') diff --git a/lua/lvim/core/bufferline.lua b/lua/lvim/core/bufferline.lua index a9b35cff..2bc366fc 100644 --- a/lua/lvim/core/bufferline.lua +++ b/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 -- cgit v1.2.3