diff --git a/ChangeLog b/ChangeLog
index baa65f749..127ab18f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@ ChangeLog - 2008-10-02
Version 0.2.7 (under dev!):
+ * add new option scroll_page_percent to choose percent of height to scroll
+ with page_up and page_down keys (task #8702)
* add new /layout command and save_layout_on_exit config option, to
save/restore windows and buffers order (task #5453)
* fix network connection for hostnames resolving to several IPs: try all
diff --git a/doc/de/autogen/weechat_options.xml b/doc/de/autogen/weechat_options.xml
index b9d29581b..45245a107 100644
--- a/doc/de/autogen/weechat_options.xml
+++ b/doc/de/autogen/weechat_options.xml
@@ -1782,6 +1782,22 @@
+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
+
+
+ values: 1 .. 100
+
+
+ default value: 100
+
+
+
weechat.look.set_title
diff --git a/doc/en/autogen/weechat_options.xml b/doc/en/autogen/weechat_options.xml
index 1b4a7fd17..5f43387e2 100644
--- a/doc/en/autogen/weechat_options.xml
+++ b/doc/en/autogen/weechat_options.xml
@@ -1782,6 +1782,22 @@
+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
+
+
+ values: 1 .. 100
+
+
+ default value: 100
+
+
+
weechat.look.set_title
diff --git a/doc/fr/autogen/weechat_options.xml b/doc/fr/autogen/weechat_options.xml
index 2e5ea1a84..d5f430242 100644
--- a/doc/fr/autogen/weechat_options.xml
+++ b/doc/fr/autogen/weechat_options.xml
@@ -1782,6 +1782,22 @@
+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
+
+
+ valeurs: 1 .. 100
+
+
+ valeur par défaut: 100
+
+
+
weechat.look.set_title
diff --git a/po/cs.po b/po/cs.po
index f79216769..cc3c1e99b 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: 2008-09-17 16:19+0200\n"
"Last-Translator: Jiri Golembiovsky \n"
"Language-Team: weechat-dev \n"
@@ -1280,6 +1280,11 @@ msgstr ""
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 ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr "nastaví titulek okna (terminálu pro Cruses GUI) s jménem a verzí"
diff --git a/po/de.po b/po/de.po
index bd6de754c..84ff81d68 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: 2007-09-06 12:44+0200\n"
"Last-Translator: Thomas Schuetz \n"
"Language-Team: weechat-dev \n"
@@ -1238,6 +1238,11 @@ msgstr ""
msgid "how many lines to scroll by with scroll_up and scroll_down"
msgstr "Anzahl der zu scrollenden Zeilen bei Bild-Hoch- und Bild-Runter-Taste"
+msgid ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
"Fenstertitel setzen (oder Terminaltitel im Curses-GUI) mit Name und Version"
diff --git a/po/es.po b/po/es.po
index 087691eb5..f01869bff 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: 2007-09-19 12:09+0200\n"
"Last-Translator: Roberto González Cardenete \n"
"Language-Team: weechat-dev \n"
@@ -1221,6 +1221,11 @@ msgstr ""
msgid "how many lines to scroll by with scroll_up and scroll_down"
msgstr "cuántas lÃneas a desplazar con scroll_up and scroll_down"
+msgid ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
"define el tÃtulo de la ventana (el terminal para la interfaz Curses) con el "
diff --git a/po/fr.po b/po/fr.po
index e515b53d3..4194ef01e 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
-"PO-Revision-Date: 2008-10-02 17:58+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
+"PO-Revision-Date: 2008-10-02 18:45+0200\n"
"Last-Translator: FlashCode \n"
"Language-Team: weechat-dev \n"
"MIME-Version: 1.0\n"
@@ -1288,6 +1288,13 @@ 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 ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+"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)"
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
"définit le titre de la fenêtre (terminal pour l'interface Curses) avec le "
diff --git a/po/hu.po b/po/hu.po
index 4b84a8a7a..648ae4e88 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: 2007-10-10 18:07+0200\n"
"Last-Translator: Andras Voroskoi \n"
"Language-Team: weechat-dev \n"
@@ -1247,6 +1247,11 @@ 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 ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
"ablak címsorának beállítása (Curses GUI esetén a terminálé) a program nevére "
diff --git a/po/ru.po b/po/ru.po
index a8a67515f..0806df15f 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: 2007-09-06 12:44+0200\n"
"Last-Translator: Pavel Shevchuk \n"
"Language-Team: weechat-dev \n"
@@ -1250,6 +1250,11 @@ msgstr ""
msgid "how many lines to scroll by with scroll_up and scroll_down"
msgstr "количество проматываемых кнопками PageUp и PageDown строк"
+msgid ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
"устанавливать заголовок окна (терминала при интерфейсе Curses) с именем и "
diff --git a/po/weechat.pot b/po/weechat.pot
index f613296d4..d3623fccd 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: 2008-10-02 17:51+0200\n"
+"POT-Creation-Date: 2008-10-02 18:44+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -1039,6 +1039,11 @@ msgstr ""
msgid "how many lines to scroll by with scroll_up and scroll_down"
msgstr ""
+msgid ""
+"percent of screen to scroll when scrolling one page up or down (for example "
+"100 means one page, 50 half-page)"
+msgstr ""
+
msgid "set title for window (terminal for Curses GUI) with name and version"
msgstr ""
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 5053680e3..83a069269 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -98,6 +98,7 @@ struct t_config_option *config_look_read_marker;
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_page_percent;
struct t_config_option *config_look_set_title;
/* config, colors section */
@@ -1061,6 +1062,12 @@ config_weechat_init ()
N_("how many lines to scroll by with scroll_up and "
"scroll_down"),
NULL, 1, INT_MAX, "3", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_scroll_page_percent = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "scroll_page_percent", "integer",
+ N_("percent of screen to scroll when scrolling one page up or down "
+ "(for example 100 means one page, 50 half-page)"),
+ NULL, 1, 100, "100", NULL, NULL, NULL, NULL, NULL, NULL);
config_look_set_title = config_file_new_option (
weechat_config_file, ptr_section,
"set_title", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index afa4c05fa..dee0e6fe7 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -104,6 +104,7 @@ extern struct t_config_option *config_look_read_marker;
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_page_percent;
extern struct t_config_option *config_look_set_title;
extern struct t_config_option *config_color_separator;
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index dcdfe4a4f..bc0a3f7ca 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -762,10 +762,18 @@ void
gui_window_page_up (struct t_gui_window *window)
{
char scroll[32];
+ int num_lines;
if (!gui_ok)
return;
+ num_lines = ((window->win_chat_height - 1) *
+ CONFIG_INTEGER(config_look_scroll_page_percent)) / 100;
+ if (num_lines < 1)
+ num_lines = 1;
+ else if (num_lines > window->win_chat_height - 1)
+ num_lines = window->win_chat_height - 1;
+
switch (window->buffer->type)
{
case GUI_BUFFER_TYPE_FORMATED:
@@ -774,8 +782,8 @@ gui_window_page_up (struct t_gui_window *window)
gui_chat_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
- (-1) * (window->win_chat_height - 1) :
- (-1) * ((window->win_chat_height - 1) * 2));
+ (-1) * (num_lines) :
+ (-1) * (num_lines + window->win_chat_height - 1));
gui_chat_draw (window->buffer, 0);
if (!window->scroll)
{
@@ -789,7 +797,7 @@ gui_window_page_up (struct t_gui_window *window)
if (window->start_line)
{
snprintf (scroll, sizeof (scroll), "-%d",
- window->win_chat_height);
+ num_lines + 1);
gui_window_scroll (window, scroll);
hook_signal_send ("window_scrolled",
WEECHAT_HOOK_SIGNAL_POINTER, window);
@@ -808,12 +816,19 @@ void
gui_window_page_down (struct t_gui_window *window)
{
struct t_gui_line *ptr_line;
- int line_pos;
+ int line_pos, num_lines;
char scroll[32];
if (!gui_ok)
return;
+ num_lines = ((window->win_chat_height - 1) *
+ CONFIG_INTEGER(config_look_scroll_page_percent)) / 100;
+ if (num_lines < 1)
+ num_lines = 1;
+ else if (num_lines > window->win_chat_height - 1)
+ num_lines = window->win_chat_height - 1;
+
switch (window->buffer->type)
{
case GUI_BUFFER_TYPE_FORMATED:
@@ -821,14 +836,14 @@ gui_window_page_down (struct t_gui_window *window)
{
gui_chat_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
- window->win_chat_height - 1);
+ num_lines);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_chat_calculate_line_diff (window, &ptr_line,
&line_pos,
- window->win_chat_height - 1);
+ num_lines);
if (!ptr_line)
{
window->start_line = NULL;
@@ -847,7 +862,7 @@ gui_window_page_down (struct t_gui_window *window)
break;
case GUI_BUFFER_TYPE_FREE:
snprintf (scroll, sizeof (scroll), "+%d",
- window->win_chat_height);
+ num_lines + 1);
gui_window_scroll (window, scroll);
hook_signal_send ("window_scrolled",
WEECHAT_HOOK_SIGNAL_POINTER, window);