Skip to content

Commit

Permalink
fix(ToggleCommentAhead): Get the first comment on the line and remove…
Browse files Browse the repository at this point in the history
… spaces
  • Loading branch information
LucasTavaresA committed Feb 7, 2024
1 parent efbe102 commit be1cd57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/SingleComment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function M.ToggleCommentAhead()
table.remove(lines, b)
elseif lines[c]:find("%S+%s+" .. comment) then
-- move comment ahead of current line to a new line on top
local text, comment_text = lines[c]:match("(.*) (" .. comment .. ".*)")
local text, comment_text = lines[c]:match("(.-)%s(" .. comment .. ".*)")
table.insert(lines, c, comment_text)
lines[c + 1] = text
after_cmd = "==zv"
Expand Down

0 comments on commit be1cd57

Please sign in to comment.