summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.adoc4
-rw-r--r--doc/de/weechat_user.de.adoc8
-rw-r--r--doc/en/weechat_user.en.adoc4
-rw-r--r--doc/fr/weechat_user.fr.adoc4
-rw-r--r--doc/it/weechat_user.it.adoc8
-rw-r--r--doc/ja/weechat_user.ja.adoc8
-rw-r--r--doc/pl/weechat_user.pl.adoc8
-rw-r--r--src/plugins/buflist/buflist-mouse.c26
-rw-r--r--src/plugins/buflist/buflist.c40
9 files changed, 84 insertions, 26 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 82dbf9288..8e5eee899 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -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
diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc
index 06c00849a..8870119bf 100644
--- a/doc/de/weechat_user.de.adoc
+++ b/doc/de/weechat_user.de.adoc
@@ -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] +
diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc
index cafe0925e..7a461f817 100644
--- a/doc/en/weechat_user.en.adoc
+++ b/doc/en/weechat_user.en.adoc
@@ -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] +
diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc
index 01cf2beeb..3df1fc702 100644
--- a/doc/fr/weechat_user.fr.adoc
+++ b/doc/fr/weechat_user.fr.adoc
@@ -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] +
diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc
index cb0216088..61d394d47 100644
--- a/doc/it/weechat_user.it.adoc
+++ b/doc/it/weechat_user.it.adoc
@@ -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] +
diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc
index e82b793e4..98e840abc 100644
--- a/doc/ja/weechat_user.ja.adoc
+++ b/doc/ja/weechat_user.ja.adoc
@@ -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] +
diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc
index 3ccb2e37a..369db5ce8 100644
--- a/doc/pl/weechat_user.pl.adoc
+++ b/doc/pl/weechat_user.pl.adoc
@@ -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] +
diff --git a/src/plugins/buflist/buflist-mouse.c b/src/plugins/buflist/buflist-mouse.c
index 51584b5e7..f74b7dc6c 100644
--- a/src/plugins/buflist/buflist-mouse.c
+++ b/src/plugins/buflist/buflist-mouse.c
@@ -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;
}
diff --git a/src/plugins/buflist/buflist.c b/src/plugins/buflist/buflist.c
index 666b8ea64..688262d76 100644
--- a/src/plugins/buflist/buflist.c
+++ b/src/plugins/buflist/buflist.c
@@ -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;
}