From 1bb49313439fd5ce23e613bf0cfc4354c85bb17b Mon Sep 17 00:00:00 2001 From: Oleksandr Smirnov Date: Thu, 4 Sep 2025 16:12:44 +0300 Subject: [PATCH] fix(utils): handle case when indentation is wrong --- lua/gopher/_utils/init.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lua/gopher/_utils/init.lua b/lua/gopher/_utils/init.lua index 1d717a9..345c670 100644 --- a/lua/gopher/_utils/init.lua +++ b/lua/gopher/_utils/init.lua @@ -38,12 +38,15 @@ function utils.trimend(s) return r end --- Since indentation can be spaces or tab, that's my hack around it +-- Since indentation can be spaces or tabs, that's my hack around it ---@param line string ---@param indent integer ---@return string function utils.indent(line, indent) local char = string.sub(line, 1, 1) + if char ~= " " and char ~= "\t" then + char = " " + end return string.rep(char, indent) end