Merge lp:~widelands-dev/widelands/bug-1699778-multilineeditbox-handle-key-enter into lp:widelands

Proposed by Jukka Pakarinen
Status: Merged
Merged at revision: 8527
Proposed branch: lp:~widelands-dev/widelands/bug-1699778-multilineeditbox-handle-key-enter
Merge into: lp:widelands
Diff against target: 10 lines (+1/-0)
1 file modified
src/ui_basic/multilineeditbox.cc (+1/-0)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1699778-multilineeditbox-handle-key-enter
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+334683@code.launchpad.net

Commit message

Fix enter key handling in multilineeditbox. The cursor would remain in the old line after enter was pressed, now it's moving to the next line as expected.

Description of the change

The change in the branch fixes the bug 1699778. update() function sets the ww_valid flag off which means that multilineeditbox must be refreshed. Without the function call refresh will happen during a next call of some other key which sets the flag off.

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2928. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/311413193.
Appveyor build 2737. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1699778_multilineeditbox_handle_key_enter-2737.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Great fix, thanks!

@bunnybot merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ui_basic/multilineeditbox.cc'
2--- src/ui_basic/multilineeditbox.cc 2017-09-20 21:27:25 +0000
3+++ src/ui_basic/multilineeditbox.cc 2017-12-04 16:56:11 +0000
4@@ -375,6 +375,7 @@
5 case SDLK_KP_ENTER:
6 case SDLK_RETURN:
7 d_->insert(d_->cursor_pos, "\n");
8+ d_->update();
9 changed();
10 break;
11

Subscribers

People subscribed via source and target branches

to status/vote changes: