Skip to content

Commit

Permalink
Feat: Add more details to the error message for the parent_arrow command
Browse files Browse the repository at this point in the history
The error message for the parent_arrow command now includes the value
of the offset given to the command, instead of just the type.

Also fixed a few comments.
  • Loading branch information
hankertrix committed Dec 24, 2024
1 parent da61bfd commit cfbcfb4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,11 @@ end
local function handle_create(args, config)
--

-- Otherwise, get the user's input for the item to create
-- Get the user's input for the item to create
local user_input, event = get_user_input("Create:")

-- If the user did not confirm the input,
-- or the user input is nil,
-- If the user input is nil,
-- or if the user did not confirm the input,
-- exit the function
if not user_input or event ~= 1 then return end

Expand Down Expand Up @@ -2776,8 +2776,11 @@ local execute_parent_arrow = ya.sync(function(state, args)
if offset_type ~= "number" then
return show_error(
string.format(
"The given offset is not a `number`, instead it is a `%s`",
offset_type
"The given offset is not of the type 'number', "
.. "instead it is a '%s', "
.. "with value '%s'",
offset_type,
offset
)
)
end
Expand Down

0 comments on commit cfbcfb4

Please sign in to comment.