Skip to content

Commit dcd403e

Browse files
committed
refactor: Reorder if conditions in tone key handling logic.
1 parent 6d5d624 commit dcd403e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

Source/KeyHandler.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,12 +468,11 @@ - (BOOL)handleInput:(KeyHandlerInput *)input state:(InputState *)inState stateCa
468468
//
469469
// This allows users to use tone key to change an existing reading before
470470
// the current cursor.
471-
if (Preferences.allowChangingPriorTone &&
472-
_bpmfReadingBuffer->hasToneMarkerOnly() &&
471+
if (_bpmfReadingBuffer->hasToneMarkerOnly() &&
473472
_grid->readings().size() > 0 &&
474-
_grid->cursor() > 0) {
473+
_grid->cursor() > 0 &&
474+
Preferences.allowChangingPriorTone) {
475475
size_t cursor = _grid->cursor() - 1;
476-
// const std::string reading = _grid->readings()[cursor];
477476
const std::string& reading = _grid->readings()[cursor];
478477
if (!reading.empty() && reading[0] != '_') {
479478
Formosa::Mandarin::BopomofoReadingBuffer tmpBuffer(_bpmfReadingBuffer->keyboardLayout());

0 commit comments

Comments
 (0)