]> granicus.if.org Git - mutt/commitdiff
The following patch has an effect only when the braille_friendly
authorSébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
Tue, 4 Oct 2005 05:24:00 +0000 (05:24 +0000)
committerSébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>
Tue, 4 Oct 2005 05:24:00 +0000 (05:24 +0000)
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.

pager.c

diff --git a/pager.c b/pager.c
index 9d6962c7a15ebccd4d3e89857e156c0417d5953a..e5c89a3120825f4dab4c26834f971d7e8bc8cf22 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -707,6 +707,9 @@ classify_quote (struct q_class_t **QuoteList, const char *qptr,
   return class;
 }
 
+static int brailleLine = -1;
+static int brailleCol = -1;
+
 static int check_attachment_marker (char *);
 
 static void
@@ -720,9 +723,10 @@ resolve_types (char *buf, char *raw, struct line_t *lineInfo, int n, int last,
 
   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 +1790,12 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
 
     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