From 9bb3b05481dd24959854b825d0443634fefbe883 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Fri, 4 Sep 2020 23:15:37 -0500 Subject: [PATCH] Fold: don't fold the first line from the node Currently the fold will hide the function name, this makes it hard to have context over the fold. Leaving the first line visible makes it easy to read. --- lua/nvim-treesitter/fold.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/nvim-treesitter/fold.lua b/lua/nvim-treesitter/fold.lua index 9f83f8c30..1c5dd6cc2 100644 --- a/lua/nvim-treesitter/fold.lua +++ b/lua/nvim-treesitter/fold.lua @@ -23,6 +23,8 @@ local folds_levels = utils.memoize_by_buf_tick(function(bufnr) for _, node in ipairs(matches) do local start, _, stop, stop_col = node.node:range() + -- Don't hide the first line + start = start + 1 if stop_col > 0 then stop = stop + 1