-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(actions): Action handling of arguments #1908
Conversation
actionSet = keyReleaseActions | ||
end | ||
|
||
for _, action in ipairs(actions) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scope of this block for both these and the corresponding luaui file are the relevant sections
|
||
for _, action in ipairs(actions) do | ||
local cmd = action["command"] | ||
local extra = action["extra"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does the 'extra' come from? I can't find anywhere that would set it https://github.com/search?q=repo%3Abeyond-all-reason%2Fspring+extra+lang%3Alua&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actionList
here: https://beyond-all-reason.github.io/spring/ldoc/modules/LuaHandle.html#KeyPress
I should have put the keybindingSpec
here: https://beyond-all-reason.github.io/spring/ldoc/modules/UnsyncedRead.html#keybindingSpec
-- If not supplied, delimiter defaults to whitespace. | ||
-- Consecutive delimiters are treated as one. | ||
-- string.split(csvText, ',') csvText:split(',') | ||
local function ssplit(val, delimiter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why rename the function (or why touch it at all if the only difference is an optional arg that never gets used)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, maybe unnecessary, although I'd have preferred to have a string.split
defined instead of using this. Anyway, I'll revert it back with a more sensible name than MakeWords
Would be good if the PR didn't randomly ruin git blame and formatting. |
Ok, I'll send a PR to fix formatting first, then I'll resend this one. |
Receiving the engine actions list and parsing it correctly.
Unfortunately there's quite a bit of inconsistency on such a largely unmaintained piece of code. I standardized it with a bit of a convention I saw frequently (2 spaces for indentation).