-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
feat(linux): add newest changes from mnemonic layout support-mac to mnemonic layout support-linux 🐘 #12837
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts |
linux/mcompile/keymap/mcompile.cpp
Outdated
|
||
while (*pdk) { | ||
int n=0; | ||
while (n < (int)vec_deadkeys.size()) { |
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.
Shouldn't this be
while (n < (int)vec_deadkeys.size()) { | |
while (n < (int)vec_deadkeys.size() - 2) { |
since we're accessing vec_deadkeys[n+2]
(and n+1
)?
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.
No, its the same thing since we work with a set of 3 elements each ( vec_deadkeys is always a multiple of 3 in size) and then we do n += 3;
further down
vec_deadkeys.size()-2
and vec_deadkeys.size()
would stop the loop after the same amount of loops
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.
That is true, and it works. However, using vec_deadkeys.size() - 2
doesn't change anything in the way the current code works, but it would be a sign of defensive programming.
linux/mcompile/keymap/mcompile.cpp
Outdated
* @param dk_Table shiftstate of the deadkey | ||
* @param deadkey deadkey character | ||
* @param[out] outputPairs pointer to array of [usvk, ch_out] pairs | ||
* @param[out] dk_vec vector of [usvk, ch_out] pairs | ||
* @param keymap pointer to the currently used (underlying) keyboard Layout | ||
* @return size of array of [usvk, ch_out] pairs |
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.
* @return size of array of [usvk, ch_out] pairs | |
* @return size of vector of [usvk, ch_out] pairs |
Although I think it's triplets, not pairs.
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.
done
linux/mcompile/keymap/mcompile.cpp
Outdated
|
||
while (*pdk) { | ||
int n=0; | ||
while (n < (int)vec_deadkeys.size()) { |
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.
That is true, and it works. However, using vec_deadkeys.size() - 2
doesn't change anything in the way the current code works, but it would be a sign of defensive programming.
This PR proposes changes to mcompile linux.
The proposed changes have already been done and been approved for mcompile-mac (see #11334).
Now those changes should be added to mcompile-linux as well
@keymanapp-test-bot skip