separator can no longer be selected

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@132 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2006-12-19 22:17:06 +00:00
parent e04b210c40
commit 1455ba25a4
+5 -3
View File
@@ -521,12 +521,14 @@ void TextValueEditor::fixSelection(IndexType t, Movement dir) {
size_t seppos = val.find(_("<sep"));
while (seppos != String::npos) {
size_t sepend = skip_tag(val,match_close_tag(val, seppos));
if ((selection_start_i <= seppos && selection_end_i > 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(_("<sep"), seppos + 1);