mirror of
https://github.com/irssi/irssi.git
synced 2024-10-27 05:20:20 -04:00
Empty lines can be now sent to /EXEC -interactive windows.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2849 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
da1252cf2c
commit
80cc61b63f
@ -912,13 +912,8 @@ static void event_command(const char *line, SERVER_REC *server, void *item)
|
|||||||
|
|
||||||
g_return_if_fail(line != NULL);
|
g_return_if_fail(line != NULL);
|
||||||
|
|
||||||
if (*line == '\0') {
|
cmdchar = *line == '\0' ? NULL :
|
||||||
/* empty line, forget it. */
|
strchr(settings_get_str("cmdchars"), *line);
|
||||||
signal_stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmdchar = strchr(settings_get_str("cmdchars"), *line);
|
|
||||||
if (cmdchar != NULL && line[1] == ' ') {
|
if (cmdchar != NULL && line[1] == ' ') {
|
||||||
/* "/ text" = same as sending "text" to active channel. */
|
/* "/ text" = same as sending "text" to active channel. */
|
||||||
line += 2;
|
line += 2;
|
||||||
|
@ -931,7 +931,15 @@ static void event_text(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
|
|||||||
char *line, *str;
|
char *line, *str;
|
||||||
|
|
||||||
g_return_if_fail(data != NULL);
|
g_return_if_fail(data != NULL);
|
||||||
if (item == NULL) return;
|
|
||||||
|
if (item == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (*data == '\0') {
|
||||||
|
/* empty line, forget it. */
|
||||||
|
signal_stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
line = settings_get_bool("expand_escapes") ?
|
line = settings_get_bool("expand_escapes") ?
|
||||||
expand_escapes(data, server, item) : g_strdup(data);
|
expand_escapes(data, server, item) : g_strdup(data);
|
||||||
@ -1003,10 +1011,11 @@ void chat_completion_init(void)
|
|||||||
settings_add_bool("completion", "completion_auto", FALSE);
|
settings_add_bool("completion", "completion_auto", FALSE);
|
||||||
settings_add_int("completion", "completion_keep_publics", 50);
|
settings_add_int("completion", "completion_keep_publics", 50);
|
||||||
settings_add_int("completion", "completion_keep_privates", 10);
|
settings_add_int("completion", "completion_keep_privates", 10);
|
||||||
settings_add_bool("completion", "expand_escapes", FALSE);
|
|
||||||
settings_add_bool("completion", "completion_nicks_lowercase", FALSE);
|
settings_add_bool("completion", "completion_nicks_lowercase", FALSE);
|
||||||
settings_add_bool("completion", "completion_strict", FALSE);
|
settings_add_bool("completion", "completion_strict", FALSE);
|
||||||
|
|
||||||
|
settings_add_bool("lookandfeel", "expand_escapes", FALSE);
|
||||||
|
|
||||||
read_settings();
|
read_settings();
|
||||||
signal_add("complete word", (SIGNAL_FUNC) sig_complete_word);
|
signal_add("complete word", (SIGNAL_FUNC) sig_complete_word);
|
||||||
signal_add("complete command msg", (SIGNAL_FUNC) sig_complete_msg);
|
signal_add("complete command msg", (SIGNAL_FUNC) sig_complete_msg);
|
||||||
|
@ -199,12 +199,6 @@ static void event_command(const char *data)
|
|||||||
{
|
{
|
||||||
const char *cmdchar;
|
const char *cmdchar;
|
||||||
|
|
||||||
if (*data == '\0') {
|
|
||||||
/* empty line, forget it. */
|
|
||||||
signal_stop();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* save current command line */
|
/* save current command line */
|
||||||
current_cmdline = data;
|
current_cmdline = data;
|
||||||
|
|
||||||
@ -213,10 +207,12 @@ static void event_command(const char *data)
|
|||||||
last_command_cmd = command_cmd;
|
last_command_cmd = command_cmd;
|
||||||
|
|
||||||
g_get_current_time(&time_command_now);
|
g_get_current_time(&time_command_now);
|
||||||
command_cmd = strchr(settings_get_str("cmdchars"), *data) != NULL;
|
command_cmd = *data != '\0' &&
|
||||||
|
strchr(settings_get_str("cmdchars"), *data) != NULL;
|
||||||
|
|
||||||
/* /^command hides the output of the command */
|
/* /^command hides the output of the command */
|
||||||
cmdchar = strchr(settings_get_str("cmdchars"), *data);
|
cmdchar = *data == '\0' ? NULL :
|
||||||
|
strchr(settings_get_str("cmdchars"), *data);
|
||||||
if (cmdchar != NULL && (data[1] == '^' ||
|
if (cmdchar != NULL && (data[1] == '^' ||
|
||||||
(data[1] == *cmdchar && data[2] == '^'))) {
|
(data[1] == *cmdchar && data[2] == '^'))) {
|
||||||
command_hide_output = TRUE;
|
command_hide_output = TRUE;
|
||||||
|
@ -618,7 +618,8 @@ static void sig_window_destroyed(WINDOW_REC *window)
|
|||||||
|
|
||||||
static void event_text(const char *data, SERVER_REC *server, EXEC_WI_REC *item)
|
static void event_text(const char *data, SERVER_REC *server, EXEC_WI_REC *item)
|
||||||
{
|
{
|
||||||
if (!IS_EXEC_WI(item)) return;
|
if (!IS_EXEC_WI(item))
|
||||||
|
return;
|
||||||
|
|
||||||
net_sendbuffer_send(item->process->out, data, strlen(data));
|
net_sendbuffer_send(item->process->out, data, strlen(data));
|
||||||
net_sendbuffer_send(item->process->out, "\n", 1);
|
net_sendbuffer_send(item->process->out, "\n", 1);
|
||||||
|
@ -181,14 +181,10 @@ static void key_send_line(void)
|
|||||||
char *str, *add_history;
|
char *str, *add_history;
|
||||||
|
|
||||||
str = gui_entry_get_text(active_entry);
|
str = gui_entry_get_text(active_entry);
|
||||||
if (str == NULL || (*str == '\0' && redir == NULL)) {
|
|
||||||
g_free(str);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* we can't use gui_entry_get_text() later, since the entry might
|
/* we can't use gui_entry_get_text() later, since the entry might
|
||||||
have been destroyed after we get back */
|
have been destroyed after we get back */
|
||||||
add_history = g_strdup(str);
|
add_history = *str == '\0' ? NULL : g_strdup(str);
|
||||||
history = command_history_current(active_win);
|
history = command_history_current(active_win);
|
||||||
|
|
||||||
translate_output(str);
|
translate_output(str);
|
||||||
|
Loading…
Reference in New Issue
Block a user