editor: Fix selection anchor on text deletion

When text is deleted adjust selection anchor.
This commit is contained in:
Jan Arne Petersen 2012-09-17 15:28:10 +02:00 committed by Kristian Høgsberg
parent e386dd22c4
commit 80ad1a943d
1 changed files with 2 additions and 0 deletions

View File

@ -591,6 +591,8 @@ text_entry_delete_text(struct text_entry *entry,
if (entry->cursor > index)
entry->cursor -= length;
entry->anchor = entry->cursor;
entry->text[index] = '\0';
strcat(entry->text, entry->text + index + length);