From ebd653e08fa55b3b2265e163901157fa9e70fce1 Mon Sep 17 00:00:00 2001 From: jakewvincent Date: Mon, 17 Jun 2024 10:43:16 -0700 Subject: [PATCH] feat: Count paragraphs; distinguish from empty lines --- lua/mkdnflow/foldtext.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/mkdnflow/foldtext.lua b/lua/mkdnflow/foldtext.lua index 769c304..e3a1cf0 100644 --- a/lua/mkdnflow/foldtext.lua +++ b/lua/mkdnflow/foldtext.lua @@ -31,7 +31,7 @@ local object_type = function(text) return true end end - local object = 'other' + local object = 'par' if text then if text:gsub('%[%[.-|.-%]%]', ''):match('%s*[^\\]|.*[^\\]|%s*') @@ -56,6 +56,8 @@ local object_type = function(text) object = 'sec' elseif text:match('!%b[]%b()') then object = 'img' + elseif text:match('^%s*$') then + object = 'empty' end end return object