From 8c717cd73b5b6c5765f24551fcfb9e6e8c09eb15 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 17 Nov 2003 13:23:22 +0000 Subject: [PATCH] When pasting to empty window, don't ask about if pasting was wanted or not. Also paste them as commands, not as text to active (non-existing) channel/query. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3170 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/gui-readline.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index e94555a5..25cb8fe1 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -152,6 +152,7 @@ static void paste_send(void) { unichar *arr; GString *str; + const char *signal_name; char out[10], *text; unsigned int i; int lf; @@ -175,8 +176,10 @@ static void paste_send(void) return; } + signal_name = active_win->active == NULL ? "send command" : "send text"; + text = gui_entry_get_text(active_entry); - signal_emit("send text", 3, text, + signal_emit(signal_name, 3, text, active_win->active_server, active_win->active); g_free(text); @@ -184,7 +187,7 @@ static void paste_send(void) str = g_string_new(NULL); for (; i < paste_buffer->len; i++) { if (arr[i] == '\r' || arr[i] == '\n') { - signal_emit("send text", 3, str->str, + signal_emit(signal_name, 3, str->str, active_win->active_server, active_win->active); g_string_truncate(str, 0); @@ -239,7 +242,8 @@ static gboolean paste_timeout(gpointer data) return TRUE; } - if (paste_line_count < paste_verify_line_count) { + if (paste_line_count < paste_verify_line_count || + active_win->active == NULL) { /* paste without asking */ paste_flush(TRUE); } else if (!paste_prompt) {