1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

Added new scroll keys for a few lines up/down (default: meta-pgup/pgdn) (patch from Pistos)

This commit is contained in:
Sebastien Helleu
2006-01-25 17:52:11 +00:00
parent 1e4c1a7073
commit 464fc8abdf
36 changed files with 2788 additions and 2400 deletions
+2
View File
@@ -5,6 +5,8 @@ ChangeLog - 2006-01-25
Version 0.1.8 (under dev!):
* added new scroll keys for a few lines up/down (default: meta-pgup/pgdn)
(patch from Pistos)
* added new option "irc_away_check_max_nicks" to disable away check on
channels with high number of nicks (patch from Gwenn)
* added new command line argument for setting WeeChat homedir (-d or --dir)
+7
View File
@@ -68,6 +68,13 @@
<entry></entry>
<entry>Use same buffer for all servers</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>integer</entry>
<entry>between 1 and 2147483647</entry>
<entry></entry>
<entry>How many lines to scroll by with scroll_up and scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>string</entry>
+8
View File
@@ -97,6 +97,14 @@
<entry><literal>page_down</literal></entry>
<entry>scroll one page down</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>scroll a few lines up</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>scroll a few lines down</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>display beginning of nicklist</entry>
+7 -1
View File
@@ -564,7 +564,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<row>
<entry>PageUp / PageDown</entry>
<entry>
Show buffer history
Scroll up / down one page in buffer history
</entry>
</row>
<row>
<entry>Alt + PageUp / Alt + PageDown</entry>
<entry>
Scroll up / down a few lines in buffer history
</entry>
</row>
<row>
+7
View File
@@ -68,6 +68,13 @@
<entry>'off'</entry>
<entry>Utiliser le même tampon pour tous les serveurs</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>3</entry>
<entry>Nombre de lignes pour le défilement avec scroll_up et scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>chaîne</entry>
+8
View File
@@ -97,6 +97,14 @@
<entry><literal>page_down</literal></entry>
<entry>faire défiler d'une page vers le bas</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>faire défiler de quelques lignes vers le haut</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>faire défiler de quelques lignes vers le bas</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>afficher le début de la liste des pseudos</entry>
+8 -1
View File
@@ -574,7 +574,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<row>
<entry>PageUp / PageDown</entry>
<entry>
Afficher l'historique du tampon
Monter / descendre d'une page dans l'historique du tampon
</entry>
</row>
<row>
<entry>Alt + PageUp / Alt + PageDown</entry>
<entry>
Monter / descendre de quelques lignes dans l'historique
du tampon
</entry>
</row>
<row>
+313 -299
View File
File diff suppressed because it is too large Load Diff
+313 -299
View File
File diff suppressed because it is too large Load Diff
+315 -301
View File
File diff suppressed because it is too large Load Diff
+311 -299
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -73,6 +73,7 @@ char *cfg_look_charset_decode_utf;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_one_server_buffer;
int cfg_look_scroll_amount;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
@@ -137,6 +138,10 @@ t_config_option weechat_options_look[] =
N_("use same buffer for all servers"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_one_server_buffer, NULL, config_change_one_server_buffer },
{ "look_scroll_amount", N_("how many lines to scroll by with scroll_up and scroll_down"),
N_("how many lines to scroll by with scroll_up and scroll_down"),
OPTION_TYPE_INT, 1, INT_MAX, 3,
NULL, NULL, &cfg_look_scroll_amount, NULL, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
+1
View File
@@ -92,6 +92,7 @@ extern char *cfg_look_charset_decode_utf;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_one_server_buffer;
extern int cfg_look_scroll_amount;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
+59
View File
@@ -2711,6 +2711,65 @@ gui_window_page_down (t_gui_window *window)
}
}
/*
* gui_window_scroll_up: display previous few lines in buffer
*/
void
gui_window_scroll_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!window->first_line_displayed)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
(-1) * cfg_look_scroll_amount :
(-1) * ( (window->win_chat_height - 1) + cfg_look_scroll_amount));
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_scroll_down: display next few lines in buffer
*/
void
gui_window_scroll_down (t_gui_window *window)
{
t_gui_line *ptr_line;
int line_pos;
if (!gui_ok)
return;
if (window->start_line)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
cfg_look_scroll_amount);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_calculate_line_diff (window, &ptr_line,
&line_pos,
window->win_chat_height - 1);
if (!ptr_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
}
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_nick_beginning: go to beginning of nicklist
*/
+2
View File
@@ -86,6 +86,8 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
gui_key_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
+20
View File
@@ -878,6 +878,26 @@ gui_action_page_down (t_gui_window *window)
gui_window_page_down (window);
}
/*
* gui_action_scroll_up: display previous few lines in buffer
*/
void
gui_action_scroll_up (t_gui_window *window)
{
gui_window_scroll_up (window);
}
/*
* gui_action_scroll_down: display next few lines in buffer
*/
void
gui_action_scroll_down (t_gui_window *window)
{
gui_window_scroll_down (window);
}
/*
* gui_action_nick_beginning: go to beginning of nicklist
*/
+4
View File
@@ -87,6 +87,10 @@ t_gui_key_function gui_key_functions[] =
N_("scroll one page up") },
{ "page_down", gui_action_page_down,
N_("scroll one page down") },
{ "scroll_up", gui_action_scroll_up,
N_("scroll a few lines up") },
{ "scroll_down", gui_action_scroll_down,
N_("scroll a few lines down") },
{ "nick_beginning", gui_action_nick_beginning,
N_("display beginning of nicklist") },
{ "nick_end", gui_action_nick_end,
+4
View File
@@ -459,6 +459,8 @@ extern void gui_action_down (t_gui_window *);
extern void gui_action_down_global (t_gui_window *);
extern void gui_action_page_up (t_gui_window *);
extern void gui_action_page_down (t_gui_window *);
extern void gui_action_scroll_up (t_gui_window *);
extern void gui_action_scroll_down (t_gui_window *);
extern void gui_action_nick_beginning (t_gui_window *);
extern void gui_action_nick_end (t_gui_window *);
extern void gui_action_nick_page_up (t_gui_window *);
@@ -513,6 +515,8 @@ extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
extern t_gui_buffer *gui_get_dcc_buffer (t_gui_window *);
extern void gui_window_page_up (t_gui_window *);
extern void gui_window_page_down (t_gui_window *);
extern void gui_window_scroll_up (t_gui_window *);
extern void gui_window_scroll_down (t_gui_window *);
extern void gui_window_nick_beginning (t_gui_window *);
extern void gui_window_nick_end (t_gui_window *);
extern void gui_window_nick_page_up (t_gui_window *);
+2
View File
@@ -5,6 +5,8 @@ ChangeLog - 2006-01-25
Version 0.1.8 (under dev!):
* added new scroll keys for a few lines up/down (default: meta-pgup/pgdn)
(patch from Pistos)
* added new option "irc_away_check_max_nicks" to disable away check on
channels with high number of nicks (patch from Gwenn)
* added new command line argument for setting WeeChat homedir (-d or --dir)
+7
View File
@@ -68,6 +68,13 @@
<entry></entry>
<entry>Use same buffer for all servers</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>integer</entry>
<entry>between 1 and 2147483647</entry>
<entry></entry>
<entry>How many lines to scroll by with scroll_up and scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>string</entry>
+8
View File
@@ -97,6 +97,14 @@
<entry><literal>page_down</literal></entry>
<entry>scroll one page down</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>scroll a few lines up</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>scroll a few lines down</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>display beginning of nicklist</entry>
+7 -1
View File
@@ -564,7 +564,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<row>
<entry>PageUp / PageDown</entry>
<entry>
Show buffer history
Scroll up / down one page in buffer history
</entry>
</row>
<row>
<entry>Alt + PageUp / Alt + PageDown</entry>
<entry>
Scroll up / down a few lines in buffer history
</entry>
</row>
<row>
+7
View File
@@ -68,6 +68,13 @@
<entry>'off'</entry>
<entry>Utiliser le même tampon pour tous les serveurs</entry>
</row>
<row>
<entry><option>look_scroll_amount</option></entry>
<entry>entier</entry>
<entry>entre 1 et 2147483647</entry>
<entry>3</entry>
<entry>Nombre de lignes pour le défilement avec scroll_up et scroll_down</entry>
</row>
<row>
<entry><option>look_buffer_timestamp</option></entry>
<entry>chaîne</entry>
+8
View File
@@ -97,6 +97,14 @@
<entry><literal>page_down</literal></entry>
<entry>faire défiler d'une page vers le bas</entry>
</row>
<row>
<entry><literal>scroll_up</literal></entry>
<entry>faire défiler de quelques lignes vers le haut</entry>
</row>
<row>
<entry><literal>scroll_down</literal></entry>
<entry>faire défiler de quelques lignes vers le bas</entry>
</row>
<row>
<entry><literal>nick_beginning</literal></entry>
<entry>afficher le début de la liste des pseudos</entry>
+8 -1
View File
@@ -574,7 +574,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
<row>
<entry>PageUp / PageDown</entry>
<entry>
Afficher l'historique du tampon
Monter / descendre d'une page dans l'historique du tampon
</entry>
</row>
<row>
<entry>Alt + PageUp / Alt + PageDown</entry>
<entry>
Monter / descendre de quelques lignes dans l'historique
du tampon
</entry>
</row>
<row>
+313 -299
View File
File diff suppressed because it is too large Load Diff
+313 -299
View File
File diff suppressed because it is too large Load Diff
+315 -301
View File
File diff suppressed because it is too large Load Diff
+311 -299
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -73,6 +73,7 @@ char *cfg_look_charset_decode_utf;
char *cfg_look_charset_encode;
char *cfg_look_charset_internal;
int cfg_look_one_server_buffer;
int cfg_look_scroll_amount;
char *cfg_look_buffer_timestamp;
int cfg_look_color_nicks_number;
int cfg_look_color_actions;
@@ -137,6 +138,10 @@ t_config_option weechat_options_look[] =
N_("use same buffer for all servers"),
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE,
NULL, NULL, &cfg_look_one_server_buffer, NULL, config_change_one_server_buffer },
{ "look_scroll_amount", N_("how many lines to scroll by with scroll_up and scroll_down"),
N_("how many lines to scroll by with scroll_up and scroll_down"),
OPTION_TYPE_INT, 1, INT_MAX, 3,
NULL, NULL, &cfg_look_scroll_amount, NULL, config_change_buffer_content },
{ "look_buffer_timestamp", N_("timestamp for buffers"),
N_("timestamp for buffers"),
OPTION_TYPE_STRING, 0, 0, 0,
+1
View File
@@ -92,6 +92,7 @@ extern char *cfg_look_charset_decode_utf;
extern char *cfg_look_charset_encode;
extern char *cfg_look_charset_internal;
extern int cfg_look_one_server_buffer;
extern int cfg_look_scroll_amount;
extern char *cfg_look_buffer_timestamp;
extern int cfg_look_color_nicks_number;
extern int cfg_look_color_actions;
+59
View File
@@ -2711,6 +2711,65 @@ gui_window_page_down (t_gui_window *window)
}
}
/*
* gui_window_scroll_up: display previous few lines in buffer
*/
void
gui_window_scroll_up (t_gui_window *window)
{
if (!gui_ok)
return;
if (!window->first_line_displayed)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
(window->start_line) ?
(-1) * cfg_look_scroll_amount :
(-1) * ( (window->win_chat_height - 1) + cfg_look_scroll_amount));
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_scroll_down: display next few lines in buffer
*/
void
gui_window_scroll_down (t_gui_window *window)
{
t_gui_line *ptr_line;
int line_pos;
if (!gui_ok)
return;
if (window->start_line)
{
gui_calculate_line_diff (window, &window->start_line,
&window->start_line_pos,
cfg_look_scroll_amount);
/* check if we can display all */
ptr_line = window->start_line;
line_pos = window->start_line_pos;
gui_calculate_line_diff (window, &ptr_line,
&line_pos,
window->win_chat_height - 1);
if (!ptr_line)
{
window->start_line = NULL;
window->start_line_pos = 0;
}
gui_draw_buffer_chat (window->buffer, 0);
gui_draw_buffer_status (window->buffer, 0);
}
}
/*
* gui_window_nick_beginning: go to beginning of nicklist
*/
+2
View File
@@ -86,6 +86,8 @@ gui_input_default_key_bindings ()
gui_key_bind ( /* ^down */ "meta-Ob", "down_global");
gui_key_bind ( /* pgup */ "meta2-5~", "page_up");
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
gui_key_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
gui_key_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
+20
View File
@@ -878,6 +878,26 @@ gui_action_page_down (t_gui_window *window)
gui_window_page_down (window);
}
/*
* gui_action_scroll_up: display previous few lines in buffer
*/
void
gui_action_scroll_up (t_gui_window *window)
{
gui_window_scroll_up (window);
}
/*
* gui_action_scroll_down: display next few lines in buffer
*/
void
gui_action_scroll_down (t_gui_window *window)
{
gui_window_scroll_down (window);
}
/*
* gui_action_nick_beginning: go to beginning of nicklist
*/
+4
View File
@@ -87,6 +87,10 @@ t_gui_key_function gui_key_functions[] =
N_("scroll one page up") },
{ "page_down", gui_action_page_down,
N_("scroll one page down") },
{ "scroll_up", gui_action_scroll_up,
N_("scroll a few lines up") },
{ "scroll_down", gui_action_scroll_down,
N_("scroll a few lines down") },
{ "nick_beginning", gui_action_nick_beginning,
N_("display beginning of nicklist") },
{ "nick_end", gui_action_nick_end,
+4
View File
@@ -459,6 +459,8 @@ extern void gui_action_down (t_gui_window *);
extern void gui_action_down_global (t_gui_window *);
extern void gui_action_page_up (t_gui_window *);
extern void gui_action_page_down (t_gui_window *);
extern void gui_action_scroll_up (t_gui_window *);
extern void gui_action_scroll_down (t_gui_window *);
extern void gui_action_nick_beginning (t_gui_window *);
extern void gui_action_nick_end (t_gui_window *);
extern void gui_action_nick_page_up (t_gui_window *);
@@ -513,6 +515,8 @@ extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *);
extern t_gui_buffer *gui_get_dcc_buffer (t_gui_window *);
extern void gui_window_page_up (t_gui_window *);
extern void gui_window_page_down (t_gui_window *);
extern void gui_window_scroll_up (t_gui_window *);
extern void gui_window_scroll_down (t_gui_window *);
extern void gui_window_nick_beginning (t_gui_window *);
extern void gui_window_nick_end (t_gui_window *);
extern void gui_window_nick_page_up (t_gui_window *);