From b47c65f4087c4d82720ab7439f395aba5d6b5f40 Mon Sep 17 00:00:00 2001 From: Iordanis Petkakis <12776461+dpetka2001@users.noreply.github.com> Date: Fri, 21 Jun 2024 22:15:32 +0300 Subject: [PATCH] fix(statuscolumn): fix `folds_open = true` (#3756) After some recent changes in https://github.com/neovim/neovim/pull/28709 I was getting an error when the user had `folds_open = true` in his personal configuration whenever he pressed `o/O`. This is an attempt to fix that. ## What is this PR for? I was getting an error with `folds_open = true` in the user configuration whenever pressing `o/O` or pressing `Enter` for a new line. The error was `Error executing lua: ...e/jrn23/projects/plugins/LazyVim/lua/lazyvim/util/ui.lua:127: attempt to index a number value`. ## Does this PR fix an existing issue? No ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/util/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index f14096db..6bb8a4f7 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -124,7 +124,7 @@ function M.statuscolumn() elseif show_open_folds and not LazyVim.ui.skip_foldexpr[buf] - and vim.treesitter.foldexpr(vim.v.lnum):sub(1, 1) == ">" + and tostring(vim.treesitter.foldexpr(vim.v.lnum)):sub(1, 1) == ">" then -- fold start fold = { text = vim.opt.fillchars:get().foldopen or "", texthl = githl } end