Skip to content

Commit

Permalink
fix: reduce error to vim.notify in Portal command execution
Browse files Browse the repository at this point in the history
  • Loading branch information
cbochs committed Mar 28, 2024
1 parent 42f368f commit 76e830c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lua/portal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,15 @@ function Portal.initialize()
function(opts)
local builtin = require("portal.builtin")[opts.fargs[1]]
if not builtin then
error(("'%s' is not a valid Portal builtin"):format(builtin))
return vim.notify(("'%s' is not a valid Portal builtin"):format(builtin), vim.log.levels.ERROR)
end

local direction = opts.fargs[2]
if not vim.tbl_contains({ "forward", "backward" }, direction) then
error(("'%s' is not a valid direction. Use either 'forward' or 'backward'"):format(direction))
return vim.notify(
("'%s' is not a valid direction. Use either 'forward' or 'backward'"):format(direction),
vim.log.levels.ERROR
)
end

local reverse = direction == "backward"
Expand Down

0 comments on commit 76e830c

Please sign in to comment.