summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-06-07 15:32:17 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-06-07 15:32:17 +0000
commit80cc61b63f7ebd51dacf3d13b0dbd6205b5625e4 (patch)
treedc55dfdee2a3a27dc9d0021d46c086b045ce8641 /src/fe-common
parentda1252cf2c3cdc8adf6827197346996754ceb50b (diff)
downloadirssi-80cc61b63f7ebd51dacf3d13b0dbd6205b5625e4.zip
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
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/chat-completion.c13
-rw-r--r--src/fe-common/core/fe-core-commands.c12
-rw-r--r--src/fe-common/core/fe-exec.c3
3 files changed, 17 insertions, 11 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index d6c26ac4..abb15404 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -931,7 +931,15 @@ static void event_text(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
char *line, *str;
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") ?
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_int("completion", "completion_keep_publics", 50);
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_strict", FALSE);
+ settings_add_bool("lookandfeel", "expand_escapes", FALSE);
+
read_settings();
signal_add("complete word", (SIGNAL_FUNC) sig_complete_word);
signal_add("complete command msg", (SIGNAL_FUNC) sig_complete_msg);
diff --git a/src/fe-common/core/fe-core-commands.c b/src/fe-common/core/fe-core-commands.c
index 366dbc04..b599c810 100644
--- a/src/fe-common/core/fe-core-commands.c
+++ b/src/fe-common/core/fe-core-commands.c
@@ -199,12 +199,6 @@ static void event_command(const char *data)
{
const char *cmdchar;
- if (*data == '\0') {
- /* empty line, forget it. */
- signal_stop();
- return;
- }
-
/* save current command line */
current_cmdline = data;
@@ -213,10 +207,12 @@ static void event_command(const char *data)
last_command_cmd = command_cmd;
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 */
- cmdchar = strchr(settings_get_str("cmdchars"), *data);
+ cmdchar = *data == '\0' ? NULL :
+ strchr(settings_get_str("cmdchars"), *data);
if (cmdchar != NULL && (data[1] == '^' ||
(data[1] == *cmdchar && data[2] == '^'))) {
command_hide_output = TRUE;
diff --git a/src/fe-common/core/fe-exec.c b/src/fe-common/core/fe-exec.c
index a93f185c..68ff1c43 100644
--- a/src/fe-common/core/fe-exec.c
+++ b/src/fe-common/core/fe-exec.c
@@ -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)
{
- 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, "\n", 1);