diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-03-10 09:48:02 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-03-10 09:48:02 +0000 |
commit | a3526caf413e0b1726ef8882ccc2a79a4c699bae (patch) | |
tree | fd058c6cf781cd1c9673a230db6a031f12c1c86a | |
parent | 02a10e4f9c05e2d385c9ea30496436c855f877d4 (diff) | |
download | irssi-a3526caf413e0b1726ef8882ccc2a79a4c699bae.zip |
Make a copy of the entry buffer only when a paste begins rather than
everytime a key is pressed.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4747 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/fe-text/gui-readline.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index f86521c4..93bd1095 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -58,8 +58,8 @@ static GTimeVal last_keypress; static int paste_detect_time, paste_detect_keycount, paste_verify_line_count; static int paste_state, paste_keycount; -static char *paste_entry, *prev_entry; -static int paste_entry_pos, prev_entry_pos; +static char *paste_entry; +static int paste_entry_pos; static GArray *paste_buffer; static char *paste_old_prompt; @@ -393,8 +393,8 @@ static int check_pasting(unichar key, int diff) return FALSE; g_free(paste_entry); - paste_entry = g_strdup(prev_entry); - paste_entry_pos = prev_entry_pos; + paste_entry = gui_entry_get_text(active_entry); + paste_entry_pos = gui_entry_get_pos(active_entry); paste_state++; paste_line_count = 0; @@ -504,10 +504,6 @@ static void sig_gui_key_pressed(gpointer keyp) str[2] = '\0'; } - g_free(prev_entry); - prev_entry = gui_entry_get_text(active_entry); - prev_entry_pos = gui_entry_get_pos(active_entry); - if (escape_next_key) { escape_next_key = FALSE; gui_entry_insert_char(active_entry, key); @@ -1022,7 +1018,6 @@ void gui_readline_init(void) escape_next_key = FALSE; redir = NULL; - prev_entry = NULL; paste_state = 0; paste_keycount = 0; paste_entry = NULL; |