From: David Lawrence Ramsey Date: Wed, 5 Jul 2006 06:38:47 +0000 (+0000) Subject: in browser_refresh() and titlebar(), don't display overly long filenames X-Git-Tag: v1.9.99pre1~110 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=51b7b0e7d85cc1d80a2cc3052091649ec79873f0;p=nano.git in browser_refresh() and titlebar(), don't display overly long filenames with ellipses if the number of columns is extremely small; also, in certain places, call wnoutrefresh(bottomwin) after calling blank_statusbar(), in order to ensure that the statusbar is actually blanked git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3751 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index a777f9a0..94a71b59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,11 @@ CVS code - - Fix mouse support so that it truly ignores everything except releases and clicks of button 1. Changes to enable_mouse_support() and get_mouseinput(). (DLR) + - In certain places, call wnoutrefresh(bottomwin) after calling + blank_statusbar(), in order to ensure that the statusbar is + actually blanked. Changes to do_help(), do_continue(), + handle_sigwinch(), and update_statusbar_line(). (DLR) + (DLR) - browser.c: do_browser() - Refactor the mouse support, modeling it after do_mouse() for @@ -38,6 +43,8 @@ CVS code - lengths of "(dir)" and "(parent dir)". (DLR) - Fix problem where width wouldn't be properly initialized if the file list took up one line or less. (DLR) + - Don't display overly long filenames with ellipses if the + number of columns is extremely small. (DLR) browser_select_filename() - New function, used to select a specific filename in the list. (DLR) @@ -55,6 +62,9 @@ CVS code - display_string() - Properly handle buf[start_index]'s being a null terminator. (DLR) + titlebar() + - Don't display overly long filenames with ellipses if the + number of columns is extremely small. (DLR) - doc/syntax/c.nanorc: - Since .i and .ii are preprocessed C and C++ output, colorize them here. (Mike Frysinger) diff --git a/src/browser.c b/src/browser.c index 6cacef0b..a700056a 100644 --- a/src/browser.c +++ b/src/browser.c @@ -616,9 +616,10 @@ void browser_refresh(void) /* The maximum length of the file information in * columns: 7 for "--", "(dir)", or the file size, and * 12 for "(parent dir)". */ - bool dots = (COLS < 15 ? FALSE : filetaillen > longest - + bool dots = (COLS >= 15 && filetaillen > longest - foomaxlen - 1); - /* Do we put an ellipsis before the filename? */ + /* Do we put an ellipsis before the filename? Don't set + * this to TRUE if we have fewer than 15 columns. */ char *disp = display_string(filetail, dots ? filetaillen - longest + foomaxlen + 4 : 0, longest, FALSE); /* If we put an ellipsis before the filename, reserve 1 diff --git a/src/help.c b/src/help.c index 2597efb7..47d594c4 100644 --- a/src/help.c +++ b/src/help.c @@ -79,6 +79,7 @@ void do_help(void (*refresh_func)(void)) } bottombars(help_list); + wnoutrefresh(bottomwin); /* Get the last line of the help text. */ ptr = help_text; diff --git a/src/nano.c b/src/nano.c index b0f342c7..5d621675 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1056,6 +1056,7 @@ RETSIGTYPE do_continue(int signal) /* Redraw the contents of the windows that need it. */ blank_statusbar(); + wnoutrefresh(bottomwin); total_refresh(); #endif } @@ -1116,6 +1117,7 @@ RETSIGTYPE handle_sigwinch(int signal) /* Redraw the contents of the windows that need it. */ blank_statusbar(); + wnoutrefresh(bottomwin); currshortcut = main_list; total_refresh(); diff --git a/src/prompt.c b/src/prompt.c index 3c961fdf..e3923934 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -902,6 +902,8 @@ void update_statusbar_line(const char *curranswer, size_t index) reset_statusbar_cursor(); wattroff(bottomwin, reverse_attr); + + wnoutrefresh(bottomwin); } /* Return TRUE if we need an update after moving horizontally, and FALSE diff --git a/src/winio.c b/src/winio.c index a19e1008..1283c6ab 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2051,7 +2051,9 @@ void titlebar(const char *path) if (!newfie) { size_t lenpt = strlenpt(path), start_col; - dots = (lenpt >= space); + /* Don't set dots to TRUE if we have at least 1/3 the length of + * the screen in columns, minus two columns for spaces. */ + dots = (space >= (COLS / 3) - 2 && lenpt >= space); if (dots) { start_col = lenpt - space + 3; @@ -2941,6 +2943,7 @@ void edit_refresh(void) blank_line(edit, nlines, 0, COLS); reset_cursor(); + wnoutrefresh(edit); }