From 142fc29e2529125ef0c436e83eb7a819f1ee6386 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 31 Jan 2011 21:42:04 +0100 Subject: [PATCH] Add some chars after cursor when scrolling input line: new option weechat.look.input_cursor_scroll (bug #21391) --- ChangeLog | 2 ++ doc/de/autogen/user/weechat_options.txt | 5 +++++ doc/en/autogen/user/weechat_options.txt | 5 +++++ doc/fr/autogen/user/weechat_options.txt | 5 +++++ doc/it/autogen/user/weechat_options.txt | 5 +++++ po/cs.po | 7 ++++++- po/de.po | 7 ++++++- po/es.po | 7 ++++++- po/fr.po | 11 +++++++++-- po/hu.po | 7 ++++++- po/it.po | 7 ++++++- po/pl.po | 7 ++++++- po/pt_BR.po | 7 ++++++- po/ru.po | 7 ++++++- po/weechat.pot | 7 ++++++- src/core/wee-config.c | 7 +++++++ src/core/wee-config.h | 1 + src/gui/curses/gui-curses-bar-window.c | 13 ++++++------- 18 files changed, 99 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0754cef10..dbd87f87c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ v0.3.5-dev, 2011-01-31 Version 0.3.5 (under dev!) -------------------------- +* core: add some chars after cursor when scrolling input line: new option + weechat.look.input_cursor_scroll (bug #21391) * core: dynamically allocate color pairs (extended colors can be used without being added with command "/color add") * core: allow background for nick colors (using "/") diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index 389d41dd4..c50314a8a 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -383,6 +383,11 @@ ** Typ: boolesch ** Werte: on, off (Standardwert: `on`) +* *weechat.look.input_cursor_scroll* +** Beschreibung: `number of chars displayed after end of input line when scrolling to display end of line` +** Typ: integer +** Werte: 0 .. 100 (Standardwert: `20`) + * *weechat.look.input_share* ** Beschreibung: `Mit dieser Option kann man den Inhalt der Eingabezeile in allen Buffern verwenden. Es können dabei nur Befehle (commands), nur Text (text), beides (all) berücksichtigt werden (Der Befehlsverlauf der einzelnen Buffer bleibt hierbei erhalten)` ** Typ: integer diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index b108d28e0..e6cf30f4e 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -383,6 +383,11 @@ ** type: boolean ** values: on, off (default value: `on`) +* *weechat.look.input_cursor_scroll* +** description: `number of chars displayed after end of input line when scrolling to display end of line` +** type: integer +** values: 0 .. 100 (default value: `20`) + * *weechat.look.input_share* ** description: `share commands, text, or both in input for all buffers (there is still local history for each buffer)` ** type: integer diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index 52ad0bf7f..9159a7a18 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -383,6 +383,11 @@ ** type: booléen ** valeurs: on, off (valeur par défaut: `on`) +* *weechat.look.input_cursor_scroll* +** description: `nombre de caractères affichés après la fin de la ligne de saisie lors d'un défilement pour afficher la fin de la ligne` +** type: entier +** valeurs: 0 .. 100 (valeur par défaut: `20`) + * *weechat.look.input_share* ** description: `partage les commandes, le texte, ou les deux dans la zone de saisie pour tous les tampons (il y a toujours un historique local sur chaque tampon)` ** type: entier diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index 88e6e51a5..9c7f27fa3 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -383,6 +383,11 @@ ** tipo: bool ** valori: on, off (valore predefinito: `on`) +* *weechat.look.input_cursor_scroll* +** descrizione: `number of chars displayed after end of input line when scrolling to display end of line` +** tipo: intero +** valori: 0 .. 100 (valore predefinito: `20`) + * *weechat.look.input_share* ** descrizione: `condivide comandi, testo o entrambi in input per tutti i buffer (resta tuttavia la cronologia locale per ogni buffer)` ** tipo: intero diff --git a/po/cs.po b/po/cs.po index 5b117516c..a7c3c1f13 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 14:50+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1949,6 +1949,11 @@ msgstr "" "maximální počet jmen v hotlistu (0 = žádné jméno není zobrazeno, pouze čísla " "bufferů)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/de.po b/po/de.po index ba15ed529..9e9bb5b0b 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 20:53+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 20:13+0100\n" "Last-Translator: Nils G.\n" "Language-Team: weechat-dev \n" @@ -2046,6 +2046,11 @@ msgstr "" "Es wird nur jeweils einmal die Nummer des Buffers in der Hotlist angezeigt " "(diese Option kommt nur zum Tragen sofern KEINE Buffernamen angezeigt werden)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/es.po b/po/es.po index 28edf7f8d..5918c8d45 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1999,6 +1999,11 @@ msgstr "" "en los elementos de la lista donde el nombre NO es mostrado después del " "número)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/fr.po b/po/fr.po index 357ab49f0..1b6209d3d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" -"PO-Revision-Date: 2011-01-31 18:57+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" +"PO-Revision-Date: 2011-01-31 21:01+0100\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -2004,6 +2004,13 @@ msgstr "" "seulement aux éléments de la hotlist où le nom n'est PAS affiché après le " "numéro)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" +"nombre de caractères affichés après la fin de la ligne de saisie lors d'un " +"défilement pour afficher la fin de la ligne" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/hu.po b/po/hu.po index 225c7fc10..0ff235be4 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 14:50+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1744,6 +1744,11 @@ msgid "" "where name is NOT displayed after number)" msgstr "" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/it.po b/po/it.po index 98afa4cad..5d7854e28 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -2000,6 +2000,11 @@ msgstr "" "mantiene solo numeri univoci nella hotlist (vale solo per gli elementi della " "hotlist per cui il nome NON viene visualizzato dopo il numero)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/pl.po b/po/pl.po index 88bb89c7d..b9be3e53d 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 18:57+0100\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -2006,6 +2006,11 @@ msgstr "" "zatrzymaj unikalne numery na hotliście (stosowane tylko dla elementów " "hotlisty, w których nazwa NIE jest wyświetlana po numerze)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 9bb739439..4cce090df 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 14:51+0100\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -1997,6 +1997,11 @@ msgid "" "where name is NOT displayed after number)" msgstr "" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/ru.po b/po/ru.po index cafd2634e..7338cbab6 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.5-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: 2011-01-31 14:51+0100\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -1762,6 +1762,11 @@ msgstr "" "максимальное количество имён в хотлисте (0 = имена не показываются, только " "номера буферов)" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/po/weechat.pot b/po/weechat.pot index 18952041f..9b4d2d2d2 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-01-31 18:41+0100\n" +"POT-Creation-Date: 2011-01-31 21:01+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1503,6 +1503,11 @@ msgid "" "where name is NOT displayed after number)" msgstr "" +msgid "" +"number of chars displayed after end of input line when scrolling to display " +"end of line" +msgstr "" + msgid "" "share commands, text, or both in input for all buffers (there is still local " "history for each buffer)" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 1fcb7613e..8614adc02 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -93,6 +93,7 @@ struct t_config_option *config_look_hotlist_names_merged_buffers; struct t_config_option *config_look_hotlist_short_names; struct t_config_option *config_look_hotlist_sort; struct t_config_option *config_look_hotlist_unique_numbers; +struct t_config_option *config_look_input_cursor_scroll; struct t_config_option *config_look_input_share; struct t_config_option *config_look_input_share_overwrite; struct t_config_option *config_look_input_undo_max; @@ -1561,6 +1562,12 @@ config_weechat_init_options () N_("keep only unique numbers in hotlist (this applies only on hotlist " "items where name is NOT displayed after number)"), NULL, 0, 0, "on", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + config_look_input_cursor_scroll = config_file_new_option ( + weechat_config_file, ptr_section, + "input_cursor_scroll", "integer", + N_("number of chars displayed after end of input line when scrolling " + "to display end of line"), + NULL, 0, 100, "20", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_input_share = config_file_new_option ( weechat_config_file, ptr_section, "input_share", "integer", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index baef06f04..9ab0df34a 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -122,6 +122,7 @@ extern struct t_config_option *config_look_hotlist_names_merged_buffers; extern struct t_config_option *config_look_hotlist_short_names; extern struct t_config_option *config_look_hotlist_sort; extern struct t_config_option *config_look_hotlist_unique_numbers; +extern struct t_config_option *config_look_input_cursor_scroll; extern struct t_config_option *config_look_input_share; extern struct t_config_option *config_look_input_share_overwrite; extern struct t_config_option *config_look_input_undo_max; diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index cd4408117..bf5f7c015 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -697,13 +697,12 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, diff = length_screen_before_cursor - chars_available; if (diff > 0) { - /* - * FIXME: keep some spaces after end of input - * for example by adding something to diff, like: - * diff += (9 - (diff % 10)); - * but then scroll position has to be saved - * (in bar window ?) - */ + if (CONFIG_INTEGER(config_look_input_cursor_scroll) > 0) + { + diff += (CONFIG_INTEGER(config_look_input_cursor_scroll) + - 1 + - (diff % CONFIG_INTEGER(config_look_input_cursor_scroll))); + } /* compute new start for displaying input */ new_start_input = pos_after_start_input + gui_chat_string_real_pos (pos_after_start_input, diff);