summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-01-30 20:22:40 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-01-30 20:22:40 +0000
commit70ad116c0fa94eb1b6b26c3dfc1025cb9e987e6f (patch)
tree7b0a5f720cb12e7d3338282d870b022c0df1c840 /src/common
parent99a34347332c89e831bd6990db692b8ec10ca345 (diff)
downloadweechat-70ad116c0fa94eb1b6b26c3dfc1025cb9e987e6f.zip
Added options "look_open_near_server" and "look_nick_complete_first" (patch from Gwenn)
Diffstat (limited to 'src/common')
-rw-r--r--src/common/completion.c7
-rw-r--r--src/common/weeconfig.c10
-rw-r--r--src/common/weeconfig.h2
3 files changed, 19 insertions, 0 deletions
diff --git a/src/common/completion.c b/src/common/completion.c
index fb4f4ff90..07bcfa540 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -1059,6 +1059,11 @@ completion_nick (t_completion *completion)
if ((!completion->word_found) || word_found_seen)
{
completion->word_found = ptr_nick->nick;
+ if (cfg_look_nick_complete_first)
+ {
+ completion->position = -1;
+ return;
+ }
for (ptr_nick2 = ptr_nick->next_nick; ptr_nick2;
ptr_nick2 = ptr_nick2->next_nick)
{
@@ -1070,8 +1075,10 @@ completion_nick (t_completion *completion)
if (other_completion == 0)
completion->position = -1;
else
+ {
if (completion->position < 0)
completion->position = 0;
+ }
return;
}
other_completion++;
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c
index 7f2665e29..f80883e67 100644
--- a/src/common/weeconfig.c
+++ b/src/common/weeconfig.c
@@ -74,6 +74,7 @@ char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_one_server_buffer;
int cfg_look_scroll_amount;
+int cfg_look_open_near_server;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
@@ -88,6 +89,7 @@ int cfg_look_nickmode_empty;
char *cfg_look_no_nickname;
char *cfg_look_completor;
char *cfg_look_nick_completion_ignore;
+int cfg_look_nick_complete_first;
int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_seconds;
@@ -138,6 +140,10 @@ t_config_option weechat_options_look[] =
N_("use same buffer for all servers"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_one_server_buffer, NULL, config_change_one_server_buffer },
+ { "look_open_near_server", N_("open new channels/privates near server"),
+ N_("open new channels/privates near server"),
+ OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
+ NULL, NULL, &cfg_look_open_near_server, NULL, config_change_noop },
{ "look_scroll_amount", N_("how many lines to scroll by with scroll_up and scroll_down"),
N_("how many lines to scroll by with scroll_up and scroll_down"),
OPTION_TYPE_INT, 1, INT_MAX, 3,
@@ -192,6 +198,10 @@ t_config_option weechat_options_look[] =
N_("chars ignored for nick completion"),
OPTION_TYPE_STRING, 0, 0, 0,
"[]-^", NULL, NULL, &cfg_look_nick_completion_ignore, config_change_noop },
+ { "look_nick_complete_first", N_("complete only with first nick found"),
+ N_("complete only with first nick found"),
+ OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
+ NULL, NULL, &cfg_look_nick_complete_first, NULL, config_change_noop },
{ "look_infobar", N_("enable info bar"),
N_("enable info bar"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h
index 1e25964b2..e35bf4ed4 100644
--- a/src/common/weeconfig.h
+++ b/src/common/weeconfig.h
@@ -92,6 +92,7 @@ extern char *cfg_look_charset_decode_utf;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_one_server_buffer;
+extern int cfg_look_open_near_server;
extern int cfg_look_scroll_amount;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks_number;
@@ -105,6 +106,7 @@ extern int cfg_look_nickmode_empty;
extern char *cfg_look_no_nickname;
extern char *cfg_look_completor;
extern char *cfg_look_nick_completion_ignore;
+extern int cfg_look_nick_complete_first;
extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_seconds;