]> granicus.if.org Git - neomutt/commitdiff
refactor: clrtobot() to mutt_window_clrtobot()
authorRichard Russon <rich@flatcap.org>
Fri, 27 Sep 2019 14:52:57 +0000 (15:52 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 28 Sep 2019 02:18:27 +0000 (03:18 +0100)
Encapsulate a curses function to reduce dependencies.

menu.c
mutt_window.c
mutt_window.h
pager.c

diff --git a/menu.c b/menu.c
index d10a78db8558d1d3f94dde7442e64206c516dc10..90b2dd72e44f47f99516a1f4d36b37ca8273b0a2 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -363,7 +363,7 @@ void menu_redraw_full(struct Menu *menu)
   mutt_curses_set_color(MT_COLOR_NORMAL);
   /* clear() doesn't optimize screen redraws */
   move(0, 0);
-  clrtobot();
+  mutt_window_clrtobot();
 
   if (C_Help)
   {
@@ -1086,7 +1086,7 @@ void mutt_menu_pop_current(struct Menu *menu)
   {
     CurrentMenu = MENU_MAIN;
     move(0, 0);
-    clrtobot();
+    mutt_window_clrtobot();
   }
 }
 
index b1ba9f9463001d0451b7e3fbbe675d731c7eed4d..688dda500878476f935a5ea9305e23dd7dc1a75b 100644 (file)
@@ -98,6 +98,16 @@ void mutt_window_clearline(struct MuttWindow *win, int row)
   mutt_window_clrtoeol(win);
 }
 
+/**
+ * mutt_window_clrtobot - Clear to the bottom of the Window
+ *
+ * @note Assumes the cursor has already been positioned within the Window.
+ */
+void mutt_window_clrtobot(void)
+{
+  clrtobot();
+}
+
 /**
  * mutt_window_clrtoeol - Clear to the end of the line
  * @param win Window
index 15da6d73744c8f76879816b06b0b632bae74ecf9..1857b15d78274a551454f1b873374106a2f6fa70 100644 (file)
@@ -62,6 +62,7 @@ int  mutt_window_addch    (int ch);
 int  mutt_window_addnstr  (const char *str, int num);
 int  mutt_window_addstr   (const char *str);
 void mutt_window_clearline(struct MuttWindow *win, int row);
+void mutt_window_clrtobot (void);
 void mutt_window_clrtoeol (struct MuttWindow *win);
 int  mutt_window_move     (struct MuttWindow *win, int row, int col);
 int  mutt_window_mvaddstr (struct MuttWindow *win, int row, int col, const char *str);
diff --git a/pager.c b/pager.c
index abba138473c9a0a55cf36f6a7a6064c5b1116b7d..5cc1e820eefbdbfc22fb8901a65e9d726636e667 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1944,7 +1944,7 @@ static void pager_custom_redraw(struct Menu *pager_menu)
     mutt_curses_set_color(MT_COLOR_NORMAL);
     /* clear() doesn't optimize screen redraws */
     move(0, 0);
-    clrtobot();
+    mutt_window_clrtobot();
 
     if (IsEmail(rd->extra) && Context && ((Context->mailbox->vcount + 1) < C_PagerIndexLines))
       rd->indexlen = Context->mailbox->vcount + 1;