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
This commit is contained in:
parent
1efe6ec5be
commit
69f24bc69f
@ -103,9 +103,8 @@ int Prepend_string(char* dest, char* src, int max)
|
|||||||
sizes = max - sized;
|
sizes = max - sized;
|
||||||
}
|
}
|
||||||
|
|
||||||
memmove(dest+sizes, dest, sized);
|
memmove(dest+sizes, dest, sized+1);
|
||||||
memcpy(dest, src, sizes);
|
memcpy(dest, src, sizes);
|
||||||
|
|
||||||
return sizes;
|
return sizes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +594,8 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz
|
|||||||
{
|
{
|
||||||
int nb_added;
|
int nb_added;
|
||||||
char* data = getClipboard();
|
char* data = getClipboard();
|
||||||
if (data == NULL) continue; // No clipboard data
|
if (data == NULL)
|
||||||
|
continue; // No clipboard data
|
||||||
Cleanup_string(data, input_type);
|
Cleanup_string(data, input_type);
|
||||||
// Insert it at the cursor position
|
// Insert it at the cursor position
|
||||||
nb_added = Prepend_string(str + position, data, max_size - position);
|
nb_added = Prepend_string(str + position, data, max_size - position);
|
||||||
@ -611,6 +611,7 @@ byte Readline_ex(word x_pos,word y_pos,char * str,byte visible_size,byte max_siz
|
|||||||
nb_added--;
|
nb_added--;
|
||||||
}
|
}
|
||||||
free(data);
|
free(data);
|
||||||
|
Hide_cursor();
|
||||||
goto affichage;
|
goto affichage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user