[PATCH 4/4] editor: Fix selection anchor on text deletion

Jan Arne Petersen jpetersen at openismus.com
Mon Sep 17 06:28:10 PDT 2012


From: Jan Arne Petersen <jpetersen at openismus.com>

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 5c75ac1..af1623f 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);
 
-- 
1.7.11.4



More information about the wayland-devel mailing list