diff mcabber/src/commands.c @ 508:5a2132ba2220

Add "/buffer up" and "/buffer down"
author Mikael Berthe <mikael@lilotux.net>
date Sat, 12 Nov 2005 14:48:35 +0100
parents 74dcd0df532e
children 5c338d31de56
line wrap: on
line diff
--- a/mcabber/src/commands.c	Sat Nov 12 11:33:14 2005 +0100
+++ b/mcabber/src/commands.c	Sat Nov 12 14:48:35 2005 +0100
@@ -134,9 +134,11 @@
   compl_add_category_word(COMPL_ROSTER, "unread_next");
 
   // Roster category
+  compl_add_category_word(COMPL_BUFFER, "clear");
   compl_add_category_word(COMPL_BUFFER, "bottom");
-  compl_add_category_word(COMPL_BUFFER, "clear");
   compl_add_category_word(COMPL_BUFFER, "top");
+  compl_add_category_word(COMPL_BUFFER, "up");
+  compl_add_category_word(COMPL_BUFFER, "down");
   compl_add_category_word(COMPL_BUFFER, "search_backward");
   compl_add_category_word(COMPL_BUFFER, "search_forward");
   compl_add_category_word(COMPL_BUFFER, "date");
@@ -728,6 +730,26 @@
     scr_BufferTopBottom(1);
   } else if (!strcasecmp(arg, "clear")) {
     scr_BufferClear();
+  } else if (!strncasecmp(arg, "up", 2)) {
+    int nblines;
+    arg += 2;
+    if (*arg && *arg++ != ' ') {
+      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+      return;
+    }
+    nblines = atoi(arg);
+    if (nblines >= 0)
+      scr_BufferScrollUpDown(-1, nblines);
+  } else if (!strncasecmp(arg, "down", 4)) {
+    int nblines;
+    arg += 4;
+    if (*arg && *arg++ != ' ') {
+      scr_LogPrint(LPRINT_NORMAL, "Wrong or missing parameter");
+      return;
+    }
+    nblines = atoi(arg);
+    if (nblines >= 0)
+      scr_BufferScrollUpDown(1, nblines);
   } else if (!strncasecmp(arg, "search_backward", 15)) {
     arg += 15;
     if (*arg++ == ' ')