diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index 3c8f59d8..39be3c26 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -521,12 +521,14 @@ void TextValueEditor::fixSelection(IndexType t, Movement dir) { size_t seppos = val.find(_(" seppos) || - (selection_start_i >= sepend && selection_end_i < sepend)) { + if (selection_start_i <= seppos && selection_end_i > seppos) { // not on same side, move selection end before sep - //selection_end = cursor_to_index(val, index_to_cursor(val, seppos)); selection_end = index_to_cursor(val, seppos, dir); selection_end_i = cursor_to_index(val, selection_end); + } else if (selection_start_i >= sepend && selection_end_i < sepend) { + // not on same side, move selection end after sep + selection_end = index_to_cursor(val, sepend, dir); + selection_end_i = cursor_to_index(val, selection_end); } // find next separator seppos = val.find(_("