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

This commit is contained in:
Dev 2022-11-18 02:28:02 -06:00 committed by GitHub
parent b42e8c3c73
commit a8957a9d36
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

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