diff --git a/lua/neorg/modules/core/presenter/module.lua b/lua/neorg/modules/core/presenter/module.lua index 3213aa46f..cb80d01da 100644 --- a/lua/neorg/modules/core/presenter/module.lua +++ b/lua/neorg/modules/core/presenter/module.lua @@ -82,6 +82,27 @@ module.private = { nodes = {}, buf = nil, current_page = 1, + + remove_blanklines = function(t) + local copy = t + for k, _t in pairs(copy) do + -- Stops at the first non-blankline text + local found_non_blankline = false + + for i = #_t, 1, -1 do + if not found_non_blankline then + local value = _t[i] + value = string.gsub(value, "%s*", "") + if value == "" then + table.remove(copy[k], i) + else + found_non_blankline = true + end + end + end + end + return copy + end, } ---@class core.presenter @@ -221,29 +242,6 @@ module.public = { end, } -module.private = { - remove_blanklines = function(t) - local copy = t - for k, _t in pairs(copy) do - -- Stops at the first non-blankline text - local found_non_blankline = false - - for i = #_t, 1, -1 do - if not found_non_blankline then - local value = _t[i] - value = string.gsub(value, "%s*", "") - if value == "" then - table.remove(copy[k], i) - else - found_non_blankline = true - end - end - end - end - return copy - end, -} - module.on_event = function(event) if vim.tbl_contains({ "core.neorgcmd", "core.keybinds" }, event.split_type[1]) then if vim.tbl_contains({ "presenter.start" }, event.split_type[2]) then