From 6331ffdc2bfbdce5d51678c57332f867ce54d0d3 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Wed, 12 Dec 2007 12:35:14 +0000 Subject: Revert r2471, having the erase commands clear the cutbuffer when the line is empty is annoying and not useful. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4667 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-entry.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/fe-text/gui-entry.c') diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index e0b1e8e0..ecf3fc92 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -551,12 +551,12 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer) g_return_if_fail(entry != NULL); - if (entry->pos < size) + if (size == 0 || entry->pos < size) return; if (update_cutbuffer) { /* put erased text to cutbuffer */ - if (entry->cutbuffer == NULL || entry->cutbuffer_len < size) { + if (entry->cutbuffer_len < size) { g_free(entry->cutbuffer); entry->cutbuffer = g_new(unichar, size+1); } @@ -567,11 +567,6 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer) size * sizeof(unichar)); } - if (size == 0) { - /* we just wanted to clear the cutbuffer */ - return; - } - if (entry->utf8) w = cell_width(entry->text + entry->pos - size, entry->pos - size + 1)-1; -- cgit v1.2.3