X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=sidebar.c;h=c59e9825a0fa025d21ff5814449e6005fb893751;hp=4a648aa072f23ac9f43b49c259fd13689fb0d95c;hb=939231b97323754e1329160d25212083242f7e09;hpb=079e3129829f02ec9fa6e31c45d1b57deb63f663 diff --git a/sidebar.c b/sidebar.c index 4a648aa..c59e982 100644 --- a/sidebar.c +++ b/sidebar.c @@ -248,7 +248,15 @@ int draw_sidebar(int menu) { prev_show_value = option(OPTMBOXPANE); } - if ( SidebarWidth == 0 ) return 0; + if (SidebarWidth > 0 && option (OPTMBOXPANE) && mutt_strlen (SidebarDelim) >= SidebarWidth) { + mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar.")); + sleep (2); + unset_option (OPTMBOXPANE); + return (0); + } + + if (SidebarWidth == 0 || !option (OPTMBOXPANE)) + return 0; /* draw the divider */ /* SETCOLOR(MT_COLOR_STATUS); */ @@ -256,7 +264,14 @@ int draw_sidebar(int menu) { for (lines = 1; lines < LINES-1-(menu != MENU_PAGER || option (OPTSTATUSONTOP)); lines++ ) { move(lines, SidebarWidth - delim_len); - addstr (NONULL (SidebarDelim)); + if (option (OPTASCIICHARS)) + addstr (NONULL (SidebarDelim)); + else if(!option(OPTASCIICHARS) && !strcmp(SidebarDelim,"|")) + addch(ACS_VLINE); + else if ((Charset_is_utf8) && !strcmp(SidebarDelim, "|")) + addstr ("\342\224\202"); + else + addstr (NONULL (SidebarDelim)); } SETCOLOR(MT_COLOR_NORMAL);