buflist: add keys F1/F2, alt+F1/alt+F2 to scroll the buflist bar

v2.8-utf8proc
Sébastien Helleu 2017-05-23 09:49:46 +02:00
parent c88d578d2d
commit a87e3908cf
9 changed files with 84 additions and 26 deletions

View File

@ -18,6 +18,10 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
[[v1.9]]
== Version 1.9 (under dev)
New features::
* buflist: add keys kbd:[F1]/kbd:[F2], kbd:[Alt+F1]/kbd:[Alt+F2] to scroll the buflist bar
Improvements::
* core: allow index for hdata arrays in evaluation of expressions

View File

@ -1589,6 +1589,14 @@ und um eine Hilfe zu erhalten wie man es nutzt: `/help autosetbuffer`.
| kbd:[Alt+PgDn] | einige Zeilen im Verlaufsspeicher des Buffer nach unten blättern. | `/window scroll_down`
| kbd:[Alt+Home] | springt zur ersten Zeile des Verlaufsspeichers des aktuellen Buffer.s| `/window scroll_top`
| kbd:[Alt+End] | springt zur letzten Zeile des Verlaufsspeichers des aktuellen Buffers. | `/window scroll_bottom`
// TRANSLATION MISSING
| kbd:[F1] | Scroll up one page in buflist. | `/bar scroll buflist * -100%`
// TRANSLATION MISSING
| kbd:[F2] | Scroll down one page in buflist. | `/bar scroll buflist * +100%`
// TRANSLATION MISSING
| kbd:[Alt+F1] | Go to the beginning of buflist. | `/bar scroll buflist * b`
// TRANSLATION MISSING
| kbd:[Alt+F2] | Go to the end of buflist. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -1552,6 +1552,10 @@ with `/script install buffer_autoset.py` and get help with `/help autosetbuffer`
| kbd:[Alt+PgDn] | Scroll down a few lines in buffer history. | `/window scroll_down`
| kbd:[Alt+Home] | Scroll to top of buffer. | `/window scroll_top`
| kbd:[Alt+End] | Scroll to bottom of buffer. | `/window scroll_bottom`
| kbd:[F1] | Scroll up one page in buflist. | `/bar scroll buflist * -100%`
| kbd:[F2] | Scroll down one page in buflist. | `/bar scroll buflist * +100%`
| kbd:[Alt+F1] | Go to the beginning of buflist. | `/bar scroll buflist * b`
| kbd:[Alt+F2] | Go to the end of buflist. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -1601,6 +1601,10 @@ avec `/help autosetbuffer`.
| kbd:[Alt+PgDn] | Descendre de quelques lignes dans l'historique du tampon. | `/window scroll_down`
| kbd:[Alt+Home] | Aller au début du tampon. | `/window scroll_top`
| kbd:[Alt+End] | Aller à la fin du tampon. | `/window scroll_bottom`
| kbd:[F1] | Monter d'une page dans la liste des tampons. | `/bar scroll buflist * -100%`
| kbd:[F2] | Descendre d'une page dans la liste des tampons. | `/bar scroll buflist * +100%`
| kbd:[Alt+F1] | Aller au début de la liste des tampons. | `/bar scroll buflist * b`
| kbd:[Alt+F2] | Aller à la fin de la liste des tampons. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -1634,6 +1634,14 @@ with `/script install buffer_autoset.py` and get help with `/help autosetbuffer`
| kbd:[Alt+PgDn] | Scorre di qualche riga in basso nella cronologia del buffer. | `/window scroll_down`
| kbd:[Alt+Home] | Scorre in cima al buffer. | `/window scroll_top`
| kbd:[Alt+End] | Scorre alla fine del del buffer. | `/window scroll_bottom`
// TRANSLATION MISSING
| kbd:[F1] | Scroll up one page in buflist. | `/bar scroll buflist * -100%`
// TRANSLATION MISSING
| kbd:[F2] | Scroll down one page in buflist. | `/bar scroll buflist * +100%`
// TRANSLATION MISSING
| kbd:[Alt+F1] | Go to the beginning of buflist. | `/bar scroll buflist * b`
// TRANSLATION MISSING
| kbd:[Alt+F2] | Go to the end of buflist. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -1554,6 +1554,14 @@ irc サーバ "freenode" に含まれる全てのバッファに対して設定
| kbd:[Alt+PgDn] | バッファ履歴を数行分下方向にスクロール | `/window scroll_down`
| kbd:[Alt+Home] | バッファ履歴を最初までスクロール | `/window scroll_top`
| kbd:[Alt+End] | バッファ履歴を最後までスクロール | `/window scroll_bottom`
// TRANSLATION MISSING
| kbd:[F1] | Scroll up one page in buflist. | `/bar scroll buflist * -100%`
// TRANSLATION MISSING
| kbd:[F2] | Scroll down one page in buflist. | `/bar scroll buflist * +100%`
// TRANSLATION MISSING
| kbd:[Alt+F1] | Go to the beginning of buflist. | `/bar scroll buflist * b`
// TRANSLATION MISSING
| kbd:[Alt+F2] | Go to the end of buflist. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -1564,6 +1564,14 @@ Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalowa
| kbd:[Alt+PgDn] | Przewiń w dół kilka linii w historii bufora. | `/window scroll_down`
| kbd:[Alt+Home] | Przewiń na górę bufora. | `/window scroll_top`
| kbd:[Alt+End] | Przewiń na dół bufora. | `/window scroll_bottom`
// TRANSLATION MISSING
| kbd:[F1] | Scroll up one page in buflist. | `/bar scroll buflist * -100%`
// TRANSLATION MISSING
| kbd:[F2] | Scroll down one page in buflist. | `/bar scroll buflist * +100%`
// TRANSLATION MISSING
| kbd:[Alt+F1] | Go to the beginning of buflist. | `/bar scroll buflist * b`
// TRANSLATION MISSING
| kbd:[Alt+F2] | Go to the end of buflist. | `/bar scroll buflist * e`
| kbd:[Alt+←] +
kbd:[Alt+↑] +
kbd:[Ctrl+p] +

View File

@ -321,37 +321,11 @@ buflist_hsignal_cb (const void *pointer, void *data, const char *signal,
int
buflist_mouse_init ()
{
struct t_hashtable *keys;
keys = weechat_hashtable_new (4,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
if (!keys)
return 0;
weechat_hook_focus (BUFLIST_BAR_ITEM_NAME, &buflist_focus_cb, NULL, NULL);
weechat_hook_hsignal(BUFLIST_MOUSE_HSIGNAL,
&buflist_hsignal_cb, NULL, NULL);
weechat_hashtable_set (keys,
"@item(" BUFLIST_BAR_ITEM_NAME "):button1*",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@item(" BUFLIST_BAR_ITEM_NAME "):button2*",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@bar(" BUFLIST_BAR_NAME "):ctrl-wheelup",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@bar(" BUFLIST_BAR_NAME "):ctrl-wheeldown",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys, "__quiet", "1");
weechat_key_bind ("mouse", keys);
weechat_hashtable_free (keys);
return 1;
}

View File

@ -437,6 +437,8 @@ buflist_sort_buffers ()
int
weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
{
struct t_hashtable *keys;
/* make C compiler happy */
(void) argc;
(void) argv;
@ -463,6 +465,44 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
buflist_mouse_init ();
/* default keys and mouse actions */
keys = weechat_hashtable_new (32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL, NULL);
if (keys)
{
/* default keys */
weechat_hashtable_set (keys,
"meta-OP", "/bar scroll buflist * -100%");
weechat_hashtable_set (keys,
"meta-OQ", "/bar scroll buflist * +100%");
weechat_hashtable_set (keys,
"meta-meta-OP", "/bar scroll buflist * b");
weechat_hashtable_set (keys,
"meta-meta-OQ", "/bar scroll buflist * e");
weechat_key_bind ("default", keys);
/* default mouse actions */
weechat_hashtable_remove_all (keys);
weechat_hashtable_set (keys,
"@item(" BUFLIST_BAR_ITEM_NAME "):button1*",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@item(" BUFLIST_BAR_ITEM_NAME "):button2*",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@bar(" BUFLIST_BAR_NAME "):ctrl-wheelup",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys,
"@bar(" BUFLIST_BAR_NAME "):ctrl-wheeldown",
"hsignal:" BUFLIST_MOUSE_HSIGNAL);
weechat_hashtable_set (keys, "__quiet", "1");
weechat_key_bind ("mouse", keys);
}
weechat_hashtable_free (keys);
return WEECHAT_RC_OK;
}