<<< Date Index >>>     <<< Thread Index >>>

For 1.5.12 [PATCH] Cursor on beginning of message body in pager



Dear all,

The following patch has an effect only when the braille_friendly
variable is set. When this is the case, the cursor is put on the first
line of the message body, when viewing it with the pager.

If someone doesn't like the way this behaviour is achieved, please don't
hesitate to modify this patch.

Cheers,
Sébastien.

--- pager.c     2005-10-01 10:05:58.458156952 +0200
+++ pager.c.new 2005-10-01 09:58:13.410854888 +0200
@@ -707,6 +703,9 @@
   return class;
 }
 
+static int brailleLine = -1;
+static int brailleCol = -1;
+
 static int check_attachment_marker (char *);
 
 static void
@@ -720,9 +719,10 @@
 
   if (n == 0 || ISHEADER (lineInfo[n-1].type))
   {
-    if (buf[0] == '\n')
+    if (buf[0] == '\n') {
       lineInfo[n].type = MT_COLOR_NORMAL;
-    else if (n > 0 && (buf[0] == ' ' || buf[0] == '\t'))
+      getyx(stdscr, brailleLine, brailleCol);
+    } else if (n > 0 && (buf[0] == ' ' || buf[0] == '\t'))
     {
       lineInfo[n].type = lineInfo[n-1].type; /* wrapped line */
       (lineInfo[n].syntax)[0].color = (lineInfo[n-1].syntax)[0].color;
@@ -1786,7 +1748,12 @@
 
     redraw = 0;
 
-    move (statusoffset, COLS-1);
+    if (option(OPTBRAILLEFRIENDLY)) {
+      if (brailleLine!=-1) {
+        move(brailleLine+1, 0);
+        brailleLine = -1;
+      }
+    } else move (statusoffset, COLS-1);
     mutt_refresh ();
 
     if (IsHeader (extra) && OldHdr == extra->hdr && TopLine != topline