From b9ddb801231523b24b842885f366c96a65527281 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Thu, 17 Mar 2005 17:56:48 +0000 Subject: [PATCH] allow refreshing of the help browser window, as Pico does, and remove a few stray spaces from the main help text git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2386 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 5 +++++ src/global.c | 4 ++++ src/nano.c | 4 ++-- src/proto.h | 3 ++- src/winio.c | 33 +++++++++++++++++++++------------ 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24f3edf8..737c98b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -315,6 +315,11 @@ CVS code - total_refresh() - Refresh bottomwin using the value of currshortcut, and change the code around do_refresh() calls to accommodate this. (DLR) + - Split out the code that blanks the screen before refreshing it + into the new function total_blank(). + do_help() + - Refresh the screen when Ctrl-L is pressed in the help browser, + as Pico does. (DLR) - configure.ac: - Remove specific references to control key shortcuts. (DLR) - Check for the wide version of ncurses, without which multibyte diff --git a/src/global.c b/src/global.c index bc76c986..53f13bc9 100644 --- a/src/global.c +++ b/src/global.c @@ -811,6 +811,10 @@ void shortcut_init(bool unjustify) IFHELP(nano_nextline_msg, NANO_NO_KEY), NANO_NO_KEY, NANO_NO_KEY, VIEW, NULL); + sc_init_one(&help_list, NANO_REFRESH_KEY, N_("Refresh"), + IFHELP(nano_refresh_msg, NANO_NO_KEY), NANO_NO_KEY, + NANO_NO_KEY, VIEW, NULL); + sc_init_one(&help_list, NANO_EXIT_KEY, exit_msg, IFHELP(nano_exit_msg, NANO_NO_KEY), NANO_EXIT_FKEY, NANO_NO_KEY, VIEW, NULL); diff --git a/src/nano.c b/src/nano.c index 3a8413fd..3a018a5d 100644 --- a/src/nano.c +++ b/src/nano.c @@ -381,9 +381,9 @@ void help_init(void) "(M) symbol and can be entered using either the Esc, Alt or " "Meta key depending on your keyboard setup. Also, pressing Esc " "twice and then typing a three-digit decimal number from 000 to " - " 255 will enter the character with the corresponding value. " + "255 will enter the character with the corresponding value. " "The following keystrokes are available in the main editor " - " window. Alternative keys are shown in parentheses:\n\n"); + "window. Alternative keys are shown in parentheses:\n\n"); htx = _(htx); diff --git a/src/proto.h b/src/proto.h index 9a797d16..04eb01a0 100644 --- a/src/proto.h +++ b/src/proto.h @@ -634,8 +634,8 @@ void blank_titlebar(void); void blank_topbar(void); void blank_edit(void); void blank_statusbar(void); -void check_statusblank(void); void blank_bottombars(void); +void check_statusblank(void); char *display_string(const char *buf, size_t start_col, size_t len, bool dollars); void nanoget_repaint(const char *buf, const char *inputbuf, size_t x); @@ -674,6 +674,7 @@ void edit_redraw(const filestruct *old_current, size_t old_pww); void edit_refresh(void); void edit_update(topmidnone location); int do_yesno(bool all, const char *msg); +void total_blank(void); void total_refresh(void); void display_main_list(void); void do_cursorpos(bool constant); diff --git a/src/winio.c b/src/winio.c index 60a60eaf..d781aed2 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2190,6 +2190,14 @@ void blank_statusbar(void) mvwaddstr(bottomwin, 0, 0, hblank); } +void blank_bottombars(void) +{ + if (!ISSET(NO_HELP)) { + mvwaddstr(bottomwin, 1, 0, hblank); + mvwaddstr(bottomwin, 2, 0, hblank); + } +} + void check_statusblank(void) { if (statusblank > 1) @@ -2203,14 +2211,6 @@ void check_statusblank(void) } } -void blank_bottombars(void) -{ - if (!ISSET(NO_HELP)) { - mvwaddstr(bottomwin, 1, 0, hblank); - mvwaddstr(bottomwin, 2, 0, hblank); - } -} - /* Convert buf into a string that can be displayed on screen. The * caller wants to display buf starting with column start_col, and * extending for at most len columns. start_col is zero-based. len is @@ -3732,7 +3732,7 @@ int do_yesno(bool all, const char *msg) return ok; } -void total_refresh(void) +void total_blank(void) { clearok(topwin, TRUE); clearok(edit, TRUE); @@ -3744,6 +3744,11 @@ void total_refresh(void) clearok(topwin, FALSE); clearok(edit, FALSE); clearok(bottomwin, FALSE); +} + +void total_refresh(void) +{ + total_blank(); titlebar(NULL); edit_refresh(); bottombars(currshortcut); @@ -3929,10 +3934,14 @@ void do_help(void) break; } - if (line == old_line && kbinput != ERR) - goto skip_redisplay; + if (kbinput == NANO_REFRESH_KEY) + total_blank(); + else { + if (line == old_line && kbinput != ERR) + goto skip_redisplay; - blank_edit(); + blank_edit(); + } assert(COLS > 5);