From c837454c76408ce8a17cfab4732e75deb237edea Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 25 Dec 2023 10:47:10 -0600 Subject: [PATCH] fix(nvim): properly handle invalid `vim.v.count` for ufo foldlevel --- dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua b/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua index 7aaeb54b..d01f9afa 100644 --- a/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua +++ b/dots/.config/nvim/lua/plugins/configs/nvim-ufo.lua @@ -49,9 +49,9 @@ return { function() local count = vim.v.count if count == 0 then - count = nil + count = 1 end - change_buf_foldlevel_by(-(count) or -1) + change_buf_foldlevel_by(-(count)) end, desc = "UFO: Fold Less", }, @@ -60,9 +60,9 @@ return { function() local count = vim.v.count if count == 0 then - count = nil + count = 1 end - change_buf_foldlevel_by(count or 1) + change_buf_foldlevel_by(count) end, desc = "UFO: Fold More", },