From 1455ba25a4864e672443f5137506c08e62cc60e2 Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 19 Dec 2006 22:17:06 +0000 Subject: [PATCH] separator can no longer be selected git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@132 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/value/text.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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(_("