fix(nvim): properly handle invalid vim.v.count
for ufo foldlevel
This commit is contained in:
parent
759c16b101
commit
c837454c76
@ -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",
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user