mcabber/mcabber/commands.c
changeset 1762 61f0482d3993
parent 1761 106bbf7e97da
child 1772 c450d1e66c2e
--- a/mcabber/mcabber/commands.c	Sat Mar 13 16:19:46 2010 +0200
+++ b/mcabber/mcabber/commands.c	Sat Mar 13 18:12:47 2010 +0200
@@ -2103,14 +2103,20 @@
     settings_foreach(SETTINGS_TYPE_OPTION, list_option_cb, &list);
     if (list) {
       gsize max = 0;
+      gsize maxmax = scr_gettextwidth() / 3;
       GSList *lel;
       gchar *format;
       // Find out maximum key length
       for (lel = list; lel; lel = lel->next) {
         const gchar *key = lel->data;
         gsize len = strlen(key);
-        if (len > max)
+        if (len > max) {
           max = len;
+          if (max > maxmax) {
+            max = maxmax;
+            break;
+          }
+        }
       }
       // Print out list of options
       format = g_strdup_printf("%%-%us = [%%s]", max);