summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--doc/de/autogen/user/weechat_options.txt5
-rw-r--r--doc/en/autogen/user/weechat_options.txt5
-rw-r--r--doc/fr/autogen/user/weechat_options.txt5
-rw-r--r--doc/it/autogen/user/weechat_options.txt5
-rw-r--r--po/cs.po7
-rw-r--r--po/de.po7
-rw-r--r--po/es.po7
-rw-r--r--po/fr.po11
-rw-r--r--po/hu.po7
-rw-r--r--po/it.po7
-rw-r--r--po/pl.po7
-rw-r--r--po/pt_BR.po7
-rw-r--r--po/ru.po7
-rw-r--r--po/weechat.pot7
-rw-r--r--src/core/wee-config.c7
-rw-r--r--src/core/wee-config.h1
-rw-r--r--src/gui/gui-completion.c17
18 files changed, 106 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 089ae05ec..03a459f42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@ v0.3.7-dev, 2011-11-12
Version 0.3.7 (under dev!)
--------------------------
+* core: add new option weechat.completion.base_word_until_cursor: allow
+ completion in middle of words (enabled by default) (task #9771)
* core: add option "jump_last_buffer_displayed" for command /input
(key: alt+"/") (task #11553)
* core: display error in command /buffer if arguments are wrong (bug #34180)
diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt
index 39ef5325c..af0c95ae5 100644
--- a/doc/de/autogen/user/weechat_options.txt
+++ b/doc/de/autogen/user/weechat_options.txt
@@ -263,6 +263,11 @@
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute werden vor einer Farbe gesetzt (ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `default`)
+* [[option_weechat.completion.base_word_until_cursor]] *weechat.completion.base_word_until_cursor*
+** Beschreibung: `if enabled, the base word to complete ends at char before cursor; otherwise the base word ends at first space after cursor`
+** Typ: boolesch
+** Werte: on, off (Standardwert: `on`)
+
* [[option_weechat.completion.default_template]] *weechat.completion.default_template*
** Beschreibung: `Standardvorlage für die automatische Vervollständigung (in der Dokumentation finden Sie die vorgegebenen Codes und Werte)`
** Typ: Zeichenkette
diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt
index 79cd43dfd..5e1fce663 100644
--- a/doc/en/autogen/user/weechat_options.txt
+++ b/doc/en/autogen/user/weechat_options.txt
@@ -263,6 +263,11 @@
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `default`)
+* [[option_weechat.completion.base_word_until_cursor]] *weechat.completion.base_word_until_cursor*
+** description: `if enabled, the base word to complete ends at char before cursor; otherwise the base word ends at first space after cursor`
+** type: boolean
+** values: on, off (default value: `on`)
+
* [[option_weechat.completion.default_template]] *weechat.completion.default_template*
** description: `default completion template (please see documentation for template codes and values)`
** type: string
diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt
index 3e41b969e..1d26b33e2 100644
--- a/doc/fr/autogen/user/weechat_options.txt
+++ b/doc/fr/autogen/user/weechat_options.txt
@@ -263,6 +263,11 @@
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `default`)
+* [[option_weechat.completion.base_word_until_cursor]] *weechat.completion.base_word_until_cursor*
+** description: `si activé, le mot de base pour la complétion s'arrête au caractère avant le curseur; sinon le mot de base s'arrête au premier espace après le curseur`
+** type: booléen
+** valeurs: on, off (valeur par défaut: `on`)
+
* [[option_weechat.completion.default_template]] *weechat.completion.default_template*
** description: `modèle de complétion par défaut (merci de consulter la documentation pour les codes et valeurs du modèle)`
** type: chaîne
diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt
index 3d84bd8d7..dab468186 100644
--- a/doc/it/autogen/user/weechat_options.txt
+++ b/doc/it/autogen/user/weechat_options.txt
@@ -263,6 +263,11 @@
** tipo: colore
** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `default`)
+* [[option_weechat.completion.base_word_until_cursor]] *weechat.completion.base_word_until_cursor*
+** descrizione: `if enabled, the base word to complete ends at char before cursor; otherwise the base word ends at first space after cursor`
+** tipo: bool
+** valori: on, off (valore predefinito: `on`)
+
* [[option_weechat.completion.default_template]] *weechat.completion.default_template*
** descrizione: `modello di completamento predefinito (consulta la documentazione per codici e valori del template)`
** tipo: stringa
diff --git a/po/cs.po b/po/cs.po
index 88f996e45..4298275b4 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-03 16:57+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2793,6 +2793,11 @@ msgid "text color for offline nicknames"
msgstr "barva textu pro nepřipojené přezdíveky"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/de.po b/po/de.po
index d41ddbdc1..b44efd297 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 22:58+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-08 22:03+0100\n"
"Last-Translator: Nils Görs\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3049,6 +3049,11 @@ msgid "text color for offline nicknames"
msgstr "Textfarbe von Nicknamen die Offline sind"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/es.po b/po/es.po
index 50904637c..8d1204637 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-03 16:57+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2953,6 +2953,11 @@ msgid "text color for offline nicknames"
msgstr "color para apodos desconectados"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index 823ecca66..088504fb4 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
-"PO-Revision-Date: 2011-11-08 17:15+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
+"PO-Revision-Date: 2011-11-12 16:06+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -2970,6 +2970,13 @@ msgid "text color for offline nicknames"
msgstr "couleur du texte pour les pseudos déconnectés"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+"si activé, le mot de base pour la complétion s'arrête au caractère avant le "
+"curseur; sinon le mot de base s'arrête au premier espace après le curseur"
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index e1ddc4838..f24958d4a 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-10-22 12:21+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2464,6 +2464,11 @@ msgid "text color for offline nicknames"
msgstr "távollevő felhasználók nevének színe"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 107bc1cc4..8cfd9726b 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-03 16:57+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2946,6 +2946,11 @@ msgid "text color for offline nicknames"
msgstr "colore del testo per i nick non in linea"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/pl.po b/po/pl.po
index f417d40ed..1a523704f 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-03 16:57+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2943,6 +2943,11 @@ msgid "text color for offline nicknames"
msgstr "kolor dla nieobecnych nicków"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 18546275b..6d4176be8 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-11-03 16:58+0100\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2904,6 +2904,11 @@ msgid "text color for offline nicknames"
msgstr "cor de texto para apelidos desconectados"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index 453f0bc43..eded9cd42 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: 2011-10-22 12:21+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2482,6 +2482,11 @@ msgid "text color for offline nicknames"
msgstr "цвет отошедших ников"
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 8254af587..cd3792c9e 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-11-08 17:56+0100\n"
+"POT-Creation-Date: 2011-11-12 16:06+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2150,6 +2150,11 @@ msgid "text color for offline nicknames"
msgstr ""
msgid ""
+"if enabled, the base word to complete ends at char before cursor; otherwise "
+"the base word ends at first space after cursor"
+msgstr ""
+
+msgid ""
"default completion template (please see documentation for template codes and "
"values)"
msgstr ""
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 7d1b9510d..00b2307ed 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -202,6 +202,7 @@ struct t_config_option *config_color_nicklist_offline;
/* config, completion section */
+struct t_config_option *config_completion_base_word_until_cursor;
struct t_config_option *config_completion_default_template;
struct t_config_option *config_completion_nick_add_space;
struct t_config_option *config_completion_nick_completer;
@@ -2427,6 +2428,12 @@ config_weechat_init_options ()
return 0;
}
+ config_completion_base_word_until_cursor = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "base_word_until_cursor", "boolean",
+ N_("if enabled, the base word to complete ends at char before cursor; "
+ "otherwise the base word ends at first space after cursor"),
+ NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_default_template = config_file_new_option (
weechat_config_file, ptr_section,
"default_template", "string",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 57ffd7941..e46e94707 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -222,6 +222,7 @@ extern struct t_config_option *config_color_nicklist_group;
extern struct t_config_option *config_color_nicklist_away;
extern struct t_config_option *config_color_nicklist_offline;
+extern struct t_config_option *config_completion_base_word_until_cursor;
extern struct t_config_option *config_completion_default_template;
extern struct t_config_option *config_completion_nick_add_space;
extern struct t_config_option *config_completion_nick_completer;
diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c
index 06211172a..c789022ae 100644
--- a/src/gui/gui-completion.c
+++ b/src/gui/gui-completion.c
@@ -686,12 +686,21 @@ gui_completion_find_context (struct t_gui_completion *completion,
}
pos_start = i + 1;
}
- i = pos;
- while ((i < size) && (data[i] != ' '))
+ if (CONFIG_BOOLEAN (config_completion_base_word_until_cursor))
{
- i++;
+ /* base word stops at cursor */
+ pos_end = pos - 1;
+ }
+ else
+ {
+ /* base word stops after first space found (on or after cursor) */
+ i = pos;
+ while ((i < size) && (data[i] != ' '))
+ {
+ i++;
+ }
+ pos_end = i - 1;
}
- pos_end = i - 1;
if (completion->context == GUI_COMPLETION_COMMAND)
{