1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Cutbuffer should be cleared when ^U is used in empty line (or in general, 0

chars is erased)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2471 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-16 10:11:00 +00:00 committed by cras
parent 348a97db7c
commit 82be2070e2

View File

@ -337,11 +337,11 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size)
{
g_return_if_fail(entry != NULL);
if (entry->pos < size || size == 0)
if (entry->pos < size)
return;
/* put erased text to cutbuffer */
if (entry->cutbuffer_len < size) {
if (entry->cutbuffer == NULL || entry->cutbuffer_len < size) {
g_free(entry->cutbuffer);
entry->cutbuffer = g_new(unichar, size+1);
}
@ -351,6 +351,11 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size)
memcpy(entry->cutbuffer, entry->text + entry->pos - size,
size * sizeof(unichar));
if (size == 0) {
/* we just wanted to clear the cutbuffer */
return;
}
g_memmove(entry->text + entry->pos - size, entry->text + entry->pos,
(entry->text_len-entry->pos+1) * sizeof(unichar));