From 69f24bc69f6a3304cbbbe07bc6a47e8b6691c98d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Tue, 25 Sep 2012 22:27:02 +0000 Subject: [PATCH] Text tool: Fix issue 487 (pasting from clipboard 'resurrects' older long string) and fix a mouse cursor dropping. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2009 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/readline.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/readline.c b/src/readline.c index adb3c4ed..b2bc92af 100644 --- a/src/readline.c +++ b/src/readline.c @@ -103,9 +103,8 @@ int Prepend_string(char* dest, char* src, int max) sizes = max - sized; } - memmove(dest+sizes, dest, sized); + memmove(dest+sizes, dest, sized+1); memcpy(dest, src, sizes); - return sizes; } @@ -595,8 +594,9 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz { int nb_added; char* data = getClipboard(); - if (data == NULL) continue; // No clipboard data - Cleanup_string(data, input_type); + if (data == NULL) + continue; // No clipboard data + Cleanup_string(data, input_type); // Insert it at the cursor position nb_added = Prepend_string(str + position, data, max_size - position); while (nb_added) @@ -611,6 +611,7 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz nb_added--; } free(data); + Hide_cursor(); goto affichage; }