-
Notifications
You must be signed in to change notification settings - Fork 47
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 input text cursor movement tests #9
Conversation
Unblocks imgui/pull/6067
IM_CHECK_EQ(state->GetCursorPos(), 6 + 5); // "Hello world|. Foo.bar!!!" // VS-Win: STOP, GitHubWeb-Win: SKIP | ||
KeyPressAndDebugPrint(chord_word_prev); | ||
#endif | ||
IM_CHECK_EQ(state->GetCursorPos(), 6); // "Hello |world. Foo.bar!!!" | ||
|
||
KeyPressAndDebugPrint(chord_word_prev); | ||
IM_CHECK_EQ(state->GetCursorPos(), 0); // "|Hello world. Foo.bar!!!" | ||
|
||
KeyPressAndDebugPrint(chord_word_prev); | ||
IM_CHECK_EQ(state->GetCursorPos(), 0); // "|Hello world. Foo.bar!!!" // (no-op) |
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.
Not sure if this functionality is tested elsewhere and this test is useless or not.
} | ||
else | ||
{ | ||
// OSX | ||
KeyPressAndDebugPrint(chord_word_next); | ||
IM_CHECK_EQ(state->GetCursorPos(), 5); // "Hello|" | ||
ImGui::SetActiveID(state->ID, ImGui::GetCurrentWindow()); |
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.
These lines were necessary for me to test on Windows since the Alt keypress will change the focus to the dropdown arrow, causing the next keypress to not be registered by the inputtext widget. Of course a more robust solution is needed but I couldn't find one quickly.
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 part was actually a bug on OSX which was fixed by fc50532 around the time you made that PR, so I'm removing those lines now.
aa12207
to
057b5a9
Compare
…in order to support separator changes (#9) Main repo: Unblocks imgui/pull/6067
Merged as cc40e07, thank you! |
Unblocks imgui/pull/6067
This change fixes a couple of bugs in the input text tests, and changes the ifdef checks to check against a version number (which may be the incorrect one once the PR in the main repo is merged). I'm also not confident that these tests will pass with older version of ImGui due to not being able to test them, though if they worked before then they still should now.