Skip to content

Commit 9732d2f

Browse files
committed
chore: inline error helper function
because i was using it only in one place
1 parent 18a8dc0 commit 9732d2f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lua/Comment/utils.lua

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ U.cmotion = {
4848
V = 5,
4949
}
5050

51-
---Print a msg on stderr
52-
---@param msg string
53-
function U.eprint(msg)
54-
vim.notify('Comment :: ' .. msg, vim.log.levels.ERROR)
55-
end
56-
5751
---Check whether the line is empty
5852
---@param ln string
5953
---@return boolean
@@ -174,8 +168,12 @@ end
174168
---@return string|boolean
175169
function U.unwrap_cstr(cstr)
176170
local lcs, rcs = cstr:match('(.*)%%s(.*)')
171+
177172
if not (lcs or rcs) then
178-
return U.eprint(("Invalid commentstring: %q. Run ':h commentstring' for help."):format(cstr))
173+
return vim.notify(
174+
("[Comment] Invalid commentstring - %q. Run ':h commentstring' for help."):format(cstr),
175+
vim.log.levels.ERROR
176+
)
179177
end
180178

181179
-- Return false if a part is empty, otherwise trim it

0 commit comments

Comments
 (0)