X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fmenu.c;h=01f0ab811818abed03ee8543fd879db6b7c2f408;hp=a99646f601d905bd4e0b5fd553f13849c151430b;hb=e7a772dca1b86e4036d25038ee67aa34dd217c07;hpb=1ee89902de184a640c171ae3285bff6882a791bd diff --git a/lib-ui/menu.c b/lib-ui/menu.c index a99646f..01f0ab8 100644 --- a/lib-ui/menu.c +++ b/lib-ui/menu.c @@ -117,7 +117,7 @@ static void print_enriched_string (int attr, unsigned char *s, int do_color) if (do_color) attrset (attr); } - else if ((k = mbrtowc (&wc, (char *) s, n, &mbstate)) > 0) { + else if ((k = mbrtowc (&wc, (char *) s, n, &mbstate)) != (size_t)-1) { addnstr ((char *) s, k); s += k, n -= k; } @@ -136,16 +136,13 @@ static void menu_make_entry (char *s, int l, MUTTMENU * menu, int i) menu->make_entry (s, l, menu, i); } -void menu_pad_string (char *s, size_t n) +static void menu_pad_string (char *s, size_t n) { int shift = option (OPTARROWCURSOR) ? 3 : 0; int cols; char *tmpbuf = p_new(char, n); - if (option (OPTMBOXPANE)) - cols = COLS - shift - SidebarWidth; - else - cols = COLS - shift; + cols = COLS - SW - shift; mutt_format_string (tmpbuf, n, cols, cols, 0, ' ', s, m_strlen(s), 1); tmpbuf[n - 1] = 0; snprintf (s, n, "%s", tmpbuf); /* overkill */ @@ -244,8 +241,7 @@ void menu_redraw_index (MUTTMENU * menu) else CLEARLINE_WIN (i - menu->top + menu->offset); } - sidebar_draw (1); -/* sidebar_draw_frames(); */ + sidebar_draw (); menu->redraw = 0; } @@ -346,7 +342,7 @@ void menu_redraw_current (MUTTMENU * menu) menu->redraw &= REDRAW_STATUS; } -void menu_redraw_prompt (MUTTMENU * menu) +static void menu_redraw_prompt (MUTTMENU * menu) { if (menu->dialog) { if (option (OPTMSGERR)) { @@ -398,7 +394,7 @@ void menu_check_recenter (MUTTMENU * menu) void menu_jump (MUTTMENU * menu) { int n; - char buf[SHORT_STRING]; + char buf[STRING]; if (menu->max) { mutt_ungetch (LastKey, 0); @@ -459,7 +455,7 @@ void menu_prev_line (MUTTMENU * menu) * halfdown: jumplen == pagelen/2 */ #define DIRECTION ((neg * 2) + 1) -void menu_length_jump (MUTTMENU *menu, int jumplen) { +static void menu_length_jump (MUTTMENU *menu, int jumplen) { int tmp, neg = (jumplen >= 0) ? 0 : -1; int c = MIN (MenuContext, menu->pagelen / 2); @@ -597,7 +593,7 @@ void menu_current_bottom (MUTTMENU * menu) mutt_error _("No entries."); } -void menu_next_entry (MUTTMENU * menu) +static void menu_next_entry (MUTTMENU * menu) { if (menu->current < menu->max - 1) { menu->current++; @@ -607,7 +603,7 @@ void menu_next_entry (MUTTMENU * menu) mutt_error _("You are on the last entry."); } -void menu_prev_entry (MUTTMENU * menu) +static void menu_prev_entry (MUTTMENU * menu) { if (menu->current) { menu->current--; @@ -668,7 +664,7 @@ static int menu_search (MUTTMENU * menu, int op) int r; int searchDir; regex_t re; - char buf[SHORT_STRING]; + char buf[STRING]; if (op != OP_SEARCH_NEXT && op != OP_SEARCH_OPPOSITE) { m_strcpy(buf, sizeof(buf), NONULL(menu->searchBuf)); @@ -988,10 +984,6 @@ int mutt_menuLoop (MUTTMENU * menu) mutt_what_key (); break; - case OP_REBUILD_CACHE: - mx_rebuild_cache (); - break; - case OP_REDRAW: clearok (stdscr, TRUE); menu->redraw = REDRAW_FULL;