Skip to content

Commit

Permalink
refactor: don't user an error wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
declancm committed Jun 30, 2024
1 parent b9aac05 commit e74ddca
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lua/cinnamon/scroll.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ H.notify = function(message, level)
vim.notify("[cinnamon] " .. message, vim.log.levels[level])
end

---@param message string
H.error = function(message)
error("[cinnamon] " .. message)
end

---@param command string | function
---@param options? ScrollOptions
M.scroll = function(command, options)
Expand Down Expand Up @@ -117,7 +112,7 @@ H.move_cursor = function(direction, count)
elseif direction == "right" then
command = command .. "l"
else
H.error("Invalid direction: " .. direction)
error("Invalid direction: " .. direction)
end
vim.cmd(command)
end
Expand All @@ -138,7 +133,7 @@ H.scroll_view = function(direction, count)
elseif direction == "right" then
command = command .. "zl"
else
H.error("Invalid direction: " .. direction)
error("Invalid direction: " .. direction)
end
vim.cmd(command)
end
Expand Down

0 comments on commit e74ddca

Please sign in to comment.