Skip to content

Commit

Permalink
Remove continue
Browse files Browse the repository at this point in the history
  • Loading branch information
notomo committed Jul 31, 2023
1 parent 384bb0a commit 8838cdd
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lua/cmdbuf/handler/lua/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ function M.add_history(self, line)
vim.fn.histadd("cmd", self._lua(line))
end

local _delete_history = function(line)
if historylib.delete("cmd", line, [[\s*lua\s*]]) then
return
end
if historylib.delete("cmd", line, [[\s*lua\s*=]]) then
return
end
if historylib.delete("cmd", line, [[\s*=\s*]]) then
return
end
end
function M.delete_histories(_, lines)
for _, line in ipairs(lines) do
if historylib.delete("cmd", line, [[\s*lua\s*]]) then
goto continue
end
if historylib.delete("cmd", line, [[\s*lua\s*=]]) then
goto continue
end
if historylib.delete("cmd", line, [[\s*=\s*]]) then
goto continue
end
::continue::
_delete_history(line)
end
end

Expand Down

0 comments on commit 8838cdd

Please sign in to comment.