From 86489d458763968ef7a833ad00dbc905c1b0e60d Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 7 Dec 2011 16:28:32 +0100 Subject: [PATCH] core: add option "weechat.look.scroll_bottom_after_switch" (if enabled, restore old behaviour before fix of bug #25555 in version 0.3.5) --- ChangeLog | 4 +++- 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 | 8 +++++++- po/de.po | 8 +++++++- po/es.po | 8 +++++++- po/fr.po | 14 ++++++++++++-- po/hu.po | 8 +++++++- po/it.po | 8 +++++++- po/pl.po | 8 +++++++- po/pt_BR.po | 8 +++++++- po/ru.po | 8 +++++++- po/weechat.pot | 8 +++++++- src/core/wee-config.c | 8 ++++++++ src/core/wee-config.h | 1 + src/gui/curses/gui-curses-window.c | 8 ++++++++ 18 files changed, 115 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80566c6dd..ddd20feba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,14 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.7-dev, 2011-12-06 +v0.3.7-dev, 2011-12-07 Version 0.3.7 (under dev!) -------------------------- +* core: add option "weechat.look.scroll_bottom_after_switch" (if enabled, + restore old behaviour before fix of bug #25555 in version 0.3.5) * core: apply filters after full reload of configuration files (with /reload) (bug #31182) * core: allow list for option weechat.plugin.extension (makes weechat.conf diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt index e7f19e642..8c4466843 100644 --- a/doc/de/autogen/user/weechat_options.txt +++ b/doc/de/autogen/user/weechat_options.txt @@ -678,6 +678,11 @@ ** Typ: integer ** Werte: 1 .. 2147483647 (Standardwert: `3`) +* [[option_weechat.look.scroll_bottom_after_switch]] *weechat.look.scroll_bottom_after_switch* +** Beschreibung: `scroll to bottom of window after switch to another buffer (do not remember scroll position in windows); the scroll is done only for buffers with formatted content (not free content)` +** Typ: boolesch +** Werte: on, off (Standardwert: `off`) + * [[option_weechat.look.scroll_page_percent]] *weechat.look.scroll_page_percent* ** Beschreibung: `Angabe in Prozent, die die Seite hoch oder runter gescrollt werden soll (Beispiel: 100 für eine ganze Seite, 50 für eine halbe Seite)` ** Typ: integer diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index b55c2c3a9..6ffb2a993 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -678,6 +678,11 @@ ** type: integer ** values: 1 .. 2147483647 (default value: `3`) +* [[option_weechat.look.scroll_bottom_after_switch]] *weechat.look.scroll_bottom_after_switch* +** description: `scroll to bottom of window after switch to another buffer (do not remember scroll position in windows); the scroll is done only for buffers with formatted content (not free content)` +** type: boolean +** values: on, off (default value: `off`) + * [[option_weechat.look.scroll_page_percent]] *weechat.look.scroll_page_percent* ** description: `percent of screen to scroll when scrolling one page up or down (for example 100 means one page, 50 half-page)` ** type: integer diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index 5e102d9f8..e5ac6809f 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -678,6 +678,11 @@ ** type: entier ** valeurs: 1 .. 2147483647 (valeur par défaut: `3`) +* [[option_weechat.look.scroll_bottom_after_switch]] *weechat.look.scroll_bottom_after_switch* +** description: `faire défiler en bas de la fenêtre après un basculemment vers un autre tampon (ne pas sauvegarder la position du défilement dans les fenêtres); le défilement n'est fait que pour les tampons avec contenu formaté (pas le contenu libre)` +** type: booléen +** valeurs: on, off (valeur par défaut: `off`) + * [[option_weechat.look.scroll_page_percent]] *weechat.look.scroll_page_percent* ** description: `pourcentage de l'écran à faire défiler lors du défilement avec page précédente ou suivante (par exemple 100 signifie une page, 50 une demi-page)` ** type: entier diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt index d1bacad4a..714cecb01 100644 --- a/doc/it/autogen/user/weechat_options.txt +++ b/doc/it/autogen/user/weechat_options.txt @@ -678,6 +678,11 @@ ** tipo: intero ** valori: 1 .. 2147483647 (valore predefinito: `3`) +* [[option_weechat.look.scroll_bottom_after_switch]] *weechat.look.scroll_bottom_after_switch* +** descrizione: `scroll to bottom of window after switch to another buffer (do not remember scroll position in windows); the scroll is done only for buffers with formatted content (not free content)` +** tipo: bool +** valori: on, off (valore predefinito: `off`) + * [[option_weechat.look.scroll_page_percent]] *weechat.look.scroll_page_percent* ** descrizione: `percentuale della schermata da scorrere in alto o in basso (per esempio 100 indica una pagina intera, 50 metà)` ** tipo: intero diff --git a/po/cs.po b/po/cs.po index cdfdf5e35..561aae0c5 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -2580,6 +2580,12 @@ msgstr "uložit rozložení při ukončení (buffery, okna nebo obojí)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "o kolik řádů posunou pomocí scroll_up a scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/de.po b/po/de.po index e45dc0950..cd23d16b3 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-08 22:03+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev \n" @@ -2814,6 +2814,12 @@ msgstr "" "Anzahl der zu scrollenden Zeilen wenn Seitenweise geblättert wird (Bild hoch/" "runter)" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/es.po b/po/es.po index dd93a26bf..789f6cd49 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -2725,6 +2725,12 @@ msgstr "guardar esquema al salir (buffers, ventanas o ambos)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "cuántas líneas a desplazar con scroll_up y scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/fr.po b/po/fr.po index 826688efe..240a2cddb 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-12-06 22:53+0100\n" -"PO-Revision-Date: 2011-11-30 10:49+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" +"PO-Revision-Date: 2011-12-07 16:25+0100\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -2730,6 +2730,16 @@ msgstr "sauve la disposition en quittant (tampons, fenêtres, ou les deux)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "nombre de lignes pour le défilement avec scroll_up et scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" +"faire défiler en bas de la fenêtre après un basculemment vers un autre " +"tampon (ne pas sauvegarder la position du défilement dans les fenêtres); le " +"défilement n'est fait que pour les tampons avec contenu formaté (pas le " +"contenu libre)" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/hu.po b/po/hu.po index 30c88dae9..7c96a8dbf 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-10-22 12:21+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -2220,6 +2220,12 @@ msgstr "" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "a scroll_up és scroll_down hány sort görgessen" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/it.po b/po/it.po index 6cc625908..2fa021f96 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-15 19:37+0100\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -2713,6 +2713,12 @@ msgstr "salva layout all'uscita (buffer, finestre, o entrambi)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "le righe da scorrere con scroll_up e scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/pl.po b/po/pl.po index efb87cff0..097916153 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-03 16:57+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -2722,6 +2722,12 @@ msgstr "zapisz układ przy wyjściu (bufory, okna, lub oba)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "ile linii przewijać za pomocą scroll_up i scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/pt_BR.po b/po/pt_BR.po index bb5b4f586..c0600aea3 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-11-03 16:58+0100\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -2683,6 +2683,12 @@ msgstr "salva disposição na saída (buffers, janelas, ou ambos)" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "quantas linhas rolar com scroll_up e scroll_down" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/ru.po b/po/ru.po index beaea9ddb..ecc2d6490 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: 2011-10-22 12:21+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -2238,6 +2238,12 @@ msgstr "" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "количество проматываемых кнопками PageUp и PageDown строк" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/po/weechat.pot b/po/weechat.pot index 76be23af0..76e0eb804 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-12-06 22:53+0100\n" +"POT-Creation-Date: 2011-12-07 16:25+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1958,6 +1958,12 @@ msgstr "" msgid "how many lines to scroll by with scroll_up and scroll_down" msgstr "" +msgid "" +"scroll to bottom of window after switch to another buffer (do not remember " +"scroll position in windows); the scroll is done only for buffers with " +"formatted content (not free content)" +msgstr "" + msgid "" "percent of screen to scroll when scrolling one page up or down (for example " "100 means one page, 50 half-page)" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index da1bb0d5a..2a5a8f866 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -141,6 +141,7 @@ struct t_config_option *config_look_read_marker_string; struct t_config_option *config_look_save_config_on_exit; struct t_config_option *config_look_save_layout_on_exit; struct t_config_option *config_look_scroll_amount; +struct t_config_option *config_look_scroll_bottom_after_switch; struct t_config_option *config_look_scroll_page_percent; struct t_config_option *config_look_search_text_not_found_alert; struct t_config_option *config_look_separator_horizontal; @@ -2039,6 +2040,13 @@ config_weechat_init_options () N_("how many lines to scroll by with scroll_up and " "scroll_down"), NULL, 1, INT_MAX, "3", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + config_look_scroll_bottom_after_switch = config_file_new_option ( + weechat_config_file, ptr_section, + "scroll_bottom_after_switch", "boolean", + N_("scroll to bottom of window after switch to another buffer (do not " + "remember scroll position in windows); the scroll is done only for " + "buffers with formatted content (not free content)"), + NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); config_look_scroll_page_percent = config_file_new_option ( weechat_config_file, ptr_section, "scroll_page_percent", "integer", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 644f997b5..303647ec0 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -165,6 +165,7 @@ extern struct t_config_option *config_look_read_marker_string; extern struct t_config_option *config_look_save_config_on_exit; extern struct t_config_option *config_look_save_layout_on_exit; extern struct t_config_option *config_look_scroll_amount; +extern struct t_config_option *config_look_scroll_bottom_after_switch; extern struct t_config_option *config_look_scroll_page_percent; extern struct t_config_option *config_look_search_text_not_found_alert; extern struct t_config_option *config_look_separator_horizontal; diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index c4cc07bcc..f7fb95678 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -1053,6 +1053,14 @@ gui_window_switch_to_buffer (struct t_gui_window *window, { gui_buffer_last_displayed = window->buffer; gui_window_scroll_switch (window, buffer); + if ((buffer->type == GUI_BUFFER_TYPE_FORMATTED) + && CONFIG_BOOLEAN(config_look_scroll_bottom_after_switch)) + { + window->scroll->start_line = NULL; + window->scroll->start_line_pos = 0; + window->scroll->scrolling = 0; + window->scroll->reset_allowed = 1; + } if (!gui_buffers_visited_frozen) { gui_buffer_visited_add (window->buffer);