diff options
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | doc/de/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | doc/en/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | doc/fr/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | doc/it/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | doc/ja/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | doc/pl/autogen/user/weechat_options.adoc | 6 | ||||
-rw-r--r-- | po/cs.po | 5 | ||||
-rw-r--r-- | po/de.po | 5 | ||||
-rw-r--r-- | po/es.po | 5 | ||||
-rw-r--r-- | po/fr.po | 7 | ||||
-rw-r--r-- | po/hu.po | 5 | ||||
-rw-r--r-- | po/it.po | 5 | ||||
-rw-r--r-- | po/ja.po | 5 | ||||
-rw-r--r-- | po/pl.po | 5 | ||||
-rw-r--r-- | po/pt.po | 5 | ||||
-rw-r--r-- | po/pt_BR.po | 5 | ||||
-rw-r--r-- | po/ru.po | 5 | ||||
-rw-r--r-- | po/tr.po | 5 | ||||
-rw-r--r-- | po/weechat.pot | 5 | ||||
-rw-r--r-- | src/core/wee-config.c | 7 | ||||
-rw-r--r-- | src/core/wee-config.h | 1 | ||||
-rw-r--r-- | src/gui/gui-completion.c | 15 |
23 files changed, 109 insertions, 18 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 273be46a1..31342fec3 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: + * core: add option weechat.completion.nick_case_sensitive (issue #981) * core: add wilcard matching operator (`+=*+` and `+!*+`) in evaluation of expressions (issue #611) * core: add cut of string in evaluation of expressions with "cut:" (number of chars) and "cutscr:" (number of chars displayed on screen) * core: add ternary operator (condition) in evaluation of expressions (`${if:condition?value_if_true:value_if_false}`) diff --git a/doc/de/autogen/user/weechat_options.adoc b/doc/de/autogen/user/weechat_options.adoc index 84b0b83e2..7d962491f 100644 --- a/doc/de/autogen/user/weechat_options.adoc +++ b/doc/de/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** Werte: on, off ** Standardwert: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** Beschreibung: pass:none[case sensitive completion for nicks] +** Typ: boolesch +** Werte: on, off +** Standardwert: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** Beschreibung: pass:none[fügt eine Zeichenkette hinter die Nick-Vervollständigung ein (sofern ein Nickname das erste Wort in der Kommandozeile ist)] ** Typ: Zeichenkette diff --git a/doc/en/autogen/user/weechat_options.adoc b/doc/en/autogen/user/weechat_options.adoc index d1d5f3236..2a5376f45 100644 --- a/doc/en/autogen/user/weechat_options.adoc +++ b/doc/en/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** values: on, off ** default value: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** description: pass:none[case sensitive completion for nicks] +** type: boolean +** values: on, off +** default value: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** description: pass:none[string inserted after nick completion (when nick is first word on command line)] ** type: string diff --git a/doc/fr/autogen/user/weechat_options.adoc b/doc/fr/autogen/user/weechat_options.adoc index d58b4c119..9d4e9cafe 100644 --- a/doc/fr/autogen/user/weechat_options.adoc +++ b/doc/fr/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** valeurs: on, off ** valeur par défaut: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** description: pass:none[complétion sensible à la casse pour les pseudos] +** type: booléen +** valeurs: on, off +** valeur par défaut: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** description: pass:none[chaîne insérée après la complétion du pseudo (quand le pseudo est le premier mot sur la ligne de commande)] ** type: chaîne diff --git a/doc/it/autogen/user/weechat_options.adoc b/doc/it/autogen/user/weechat_options.adoc index 60ba6d837..791d39b64 100644 --- a/doc/it/autogen/user/weechat_options.adoc +++ b/doc/it/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** valori: on, off ** valore predefinito: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** descrizione: pass:none[case sensitive completion for nicks] +** tipo: bool +** valori: on, off +** valore predefinito: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** descrizione: pass:none[stringa inserita dopo il completamento del nick (quando il nick è la prima parola sulla riga di comando)] ** tipo: stringa diff --git a/doc/ja/autogen/user/weechat_options.adoc b/doc/ja/autogen/user/weechat_options.adoc index 1ef3bbb46..4cae805ac 100644 --- a/doc/ja/autogen/user/weechat_options.adoc +++ b/doc/ja/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** 値: on, off ** デフォルト値: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** 説明: pass:none[case sensitive completion for nicks] +** タイプ: ブール +** 値: on, off +** デフォルト値: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** 説明: pass:none[ニックネーム補完の後に追加する文字列 (ニックネームがコマンドラインの最初にある場合)] ** タイプ: 文字列 diff --git a/doc/pl/autogen/user/weechat_options.adoc b/doc/pl/autogen/user/weechat_options.adoc index 2dfe26f90..fa1872617 100644 --- a/doc/pl/autogen/user/weechat_options.adoc +++ b/doc/pl/autogen/user/weechat_options.adoc @@ -410,6 +410,12 @@ ** wartości: on, off ** domyślna wartość: `+on+` +* [[option_weechat.completion.nick_case_sensitive]] *weechat.completion.nick_case_sensitive* +** opis: pass:none[case sensitive completion for nicks] +** typ: bool +** wartości: on, off +** domyślna wartość: `+off+` + * [[option_weechat.completion.nick_completer]] *weechat.completion.nick_completer* ** opis: pass:none[ciąg wstawiany po dopełnionym nicku (kiedy nick jest pierwszym słowem w linii poleceń)] ** typ: ciąg @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 21:59+0100\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3811,6 +3811,9 @@ msgstr "" "přidat mezeru za přezdívku po doplnění (pokud není přezdívka první slovo na " "příkazovém řádku)" +msgid "case sensitive completion for nicks" +msgstr "" + #, fuzzy msgid "" "string inserted after nick completion (when nick is first word on command " @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-05-03 23:14+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -4574,6 +4574,9 @@ msgstr "" "fügt ein Leerzeichen hinter die Nick-Vervollständigung ein (sofern der " "Nickname nicht das erste Wort in einer Kommandozeile darstellt)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 22:01+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4002,6 +4002,9 @@ msgstr "" "agregar espacio después de autocompletar un apodo (cuando el apodo no es la " "primera palabra en la línea de comandos)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" -"PO-Revision-Date: 2017-05-05 23:17+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" +"PO-Revision-Date: 2017-05-06 10:12+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -4466,6 +4466,9 @@ msgstr "" "ajouter un espace après la complétion du pseudo (quand le pseudo n'est pas " "le premier mot sur la ligne de commande)" +msgid "case sensitive completion for nicks" +msgstr "complétion sensible à la casse pour les pseudos" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 22:03+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3387,6 +3387,9 @@ msgid "" "add space after nick completion (when nick is not first word on command line)" msgstr "" +msgid "case sensitive completion for nicks" +msgstr "" + #, fuzzy msgid "" "string inserted after nick completion (when nick is first word on command " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 22:04+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4113,6 +4113,9 @@ msgstr "" "aggiungi uno spazio al completamento del nick (quando non è la prima parola " "sulla riga di comando)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-05-02 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -4271,6 +4271,9 @@ msgstr "" "ニックネーム補完の後に空白を追加 (コマンドラインの最初がニックネームでない場" "合は)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-04-08 14:49+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4358,6 +4358,9 @@ msgstr "" "dodaj spację po dopełnionym nicku (kiedy nick nie jest pierwszym słowem w " "linii poleceń)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-04-08 14:50+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -4349,6 +4349,9 @@ msgstr "" "adicionar espaço depois de completar o nick (quando o nick não é a primeira " "palavra na linha de comando)" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" diff --git a/po/pt_BR.po b/po/pt_BR.po index d602c12b2..6e3363e9d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2016-09-03 08:24+0200\n" "Last-Translator: Eduardo Elias <camponez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3998,6 +3998,9 @@ msgstr "" "adiciona espaço após a completação de apelido (quando o apelido não é a " "primeira palavra na linha de comando)" +msgid "case sensitive completion for nicks" +msgstr "" + #, fuzzy msgid "" "string inserted after nick completion (when nick is first word on command " @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 22:06+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3420,6 +3420,9 @@ msgid "" "add space after nick completion (when nick is not first word on command line)" msgstr "" +msgid "case sensitive completion for nicks" +msgstr "" + #, fuzzy msgid "" "string inserted after nick completion (when nick is first word on command " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2017-01-06 22:07+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3068,6 +3068,9 @@ msgid "" "add space after nick completion (when nick is not first word on command line)" msgstr "" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" diff --git a/po/weechat.pot b/po/weechat.pot index 4279c29f8..16c57f772 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-05-05 23:16+0200\n" +"POT-Creation-Date: 2017-05-06 10:11+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3059,6 +3059,9 @@ msgid "" "add space after nick completion (when nick is not first word on command line)" msgstr "" +msgid "case sensitive completion for nicks" +msgstr "" + msgid "" "string inserted after nick completion (when nick is first word on command " "line)" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 54c78bb92..0bbaea4e3 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -264,6 +264,7 @@ struct t_config_option *config_completion_base_word_until_cursor; struct t_config_option *config_completion_command_inline; struct t_config_option *config_completion_default_template; struct t_config_option *config_completion_nick_add_space; +struct t_config_option *config_completion_nick_case_sensitive; struct t_config_option *config_completion_nick_completer; struct t_config_option *config_completion_nick_first_only; struct t_config_option *config_completion_nick_ignore_chars; @@ -4105,6 +4106,12 @@ config_weechat_init_options () "command line)"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_completion_nick_case_sensitive = config_file_new_option ( + weechat_config_file, ptr_section, + "nick_case_sensitive", "boolean", + N_("case sensitive completion for nicks"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_completer = config_file_new_option ( weechat_config_file, ptr_section, "nick_completer", "string", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index ece8dd752..1ab3b763d 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -310,6 +310,7 @@ extern struct t_config_option *config_completion_base_word_until_cursor; extern struct t_config_option *config_completion_command_inline; 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_case_sensitive; extern struct t_config_option *config_completion_nick_completer; extern struct t_config_option *config_completion_nick_first_only; extern struct t_config_option *config_completion_nick_ignore_chars; diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index d5ece75fe..22c151f1d 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -356,19 +356,26 @@ int gui_completion_nickncmp (const char *base_word, const char *nick, int max) { char *base_word2, *nick2; - int return_cmp; + int case_sensitive, return_cmp; + + case_sensitive = CONFIG_BOOLEAN(config_completion_nick_case_sensitive); if (!CONFIG_STRING(config_completion_nick_ignore_chars) || !CONFIG_STRING(config_completion_nick_ignore_chars)[0] || !base_word || !nick || !base_word[0] || !nick[0] || gui_completion_nick_has_ignored_chars (base_word)) - return string_strncasecmp (base_word, nick, max); + { + return (case_sensitive) ? + strncmp (base_word, nick, max) : + string_strncasecmp (base_word, nick, max); + } base_word2 = gui_completion_nick_strdup_ignore_chars (base_word); nick2 = gui_completion_nick_strdup_ignore_chars (nick); - return_cmp = string_strncasecmp (base_word2, nick2, - utf8_strlen (base_word2)); + return_cmp = (case_sensitive) ? + strncmp (base_word2, nick2, utf8_strlen (base_word2)) : + string_strncasecmp (base_word2, nick2, utf8_strlen (base_word2)); free (base_word2); free (nick2); |