changed <line> semantics, usage is now <line>\n</line>

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@149 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-22 20:00:18 +00:00
parent 3eece6eb61
commit 69e4edff95
8 changed files with 133 additions and 155 deletions
+8 -4
View File
@@ -79,12 +79,16 @@ void TextValueEditor::onMotion(const RealPoint& pos, wxMouseEvent& ev) {
size_t index = v.indexAt(style().getRotation().trInv(pos));
if (select_words) {
// on the left, swap start and end
bool left = index < max(selection_start_i, selection_end_i);
if (left != (selection_end_i < selection_start_i)) {
bool left = selection_end_i < selection_start_i;
size_t next = nextWordBoundry(index);
size_t prev = prevWordBoundry(index);
if (( left && next > max(selection_start_i, selection_end_i)) ||
(!left && prev < min(selection_start_i, selection_end_i))) {
left = !left;
swap(selection_start_i, selection_end_i);
}
// //if (left && selection_end_i < selection_start_i
moveSelection(TYPE_INDEX, left ? prevWordBoundry(index) : nextWordBoundry(index), false, MOVE_MID);
// TODO : still not quite right, requires a moveSelection function that moves start & end simultaniously
moveSelection(TYPE_INDEX, left ? prev : next, false, MOVE_MID);
} else {
moveSelection(TYPE_INDEX, index, false, MOVE_MID);
}