editor: Fix selection anchor on text deletion
When text is deleted adjust selection anchor.
This commit is contained in:
committed by
Kristian Høgsberg
parent
e386dd22c4
commit
80ad1a943d
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user