From 80ad1a943d6433ec598386aaa9b9bfcced590f90 Mon Sep 17 00:00:00 2001 From: Jan Arne Petersen Date: Mon, 17 Sep 2012 15:28:10 +0200 Subject: [PATCH] editor: Fix selection anchor on text deletion When text is deleted adjust selection anchor. --- clients/editor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/editor.c b/clients/editor.c index 5c75ac19..af1623fa 100644 --- a/clients/editor.c +++ b/clients/editor.c @@ -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);