mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
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
This commit is contained in:
parent
4d3d559f93
commit
8c717cd73b
@ -152,6 +152,7 @@ static void paste_send(void)
|
|||||||
{
|
{
|
||||||
unichar *arr;
|
unichar *arr;
|
||||||
GString *str;
|
GString *str;
|
||||||
|
const char *signal_name;
|
||||||
char out[10], *text;
|
char out[10], *text;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int lf;
|
int lf;
|
||||||
@ -175,8 +176,10 @@ static void paste_send(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signal_name = active_win->active == NULL ? "send command" : "send text";
|
||||||
|
|
||||||
text = gui_entry_get_text(active_entry);
|
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);
|
active_win->active_server, active_win->active);
|
||||||
g_free(text);
|
g_free(text);
|
||||||
|
|
||||||
@ -184,7 +187,7 @@ static void paste_send(void)
|
|||||||
str = g_string_new(NULL);
|
str = g_string_new(NULL);
|
||||||
for (; i < paste_buffer->len; i++) {
|
for (; i < paste_buffer->len; i++) {
|
||||||
if (arr[i] == '\r' || arr[i] == '\n') {
|
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_server,
|
||||||
active_win->active);
|
active_win->active);
|
||||||
g_string_truncate(str, 0);
|
g_string_truncate(str, 0);
|
||||||
@ -239,7 +242,8 @@ static gboolean paste_timeout(gpointer data)
|
|||||||
return TRUE;
|
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 without asking */
|
||||||
paste_flush(TRUE);
|
paste_flush(TRUE);
|
||||||
} else if (!paste_prompt) {
|
} else if (!paste_prompt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user