fix(nvim): properly handle invalid vim.v.count for ufo foldlevel

This commit is contained in:
Price Hiller 2023-12-25 10:47:10 -06:00
parent 759c16b101
commit c837454c76
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -49,9 +49,9 @@ return {
function() function()
local count = vim.v.count local count = vim.v.count
if count == 0 then if count == 0 then
count = nil count = 1
end end
change_buf_foldlevel_by(-(count) or -1) change_buf_foldlevel_by(-(count))
end, end,
desc = "UFO: Fold Less", desc = "UFO: Fold Less",
}, },
@ -60,9 +60,9 @@ return {
function() function()
local count = vim.v.count local count = vim.v.count
if count == 0 then if count == 0 then
count = nil count = 1
end end
change_buf_foldlevel_by(count or 1) change_buf_foldlevel_by(count)
end, end,
desc = "UFO: Fold More", desc = "UFO: Fold More",
}, },