Letting bottombars() set the global variable 'currmenu'.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5183 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-04-07 14:16:07 +00:00
parent d5177059e8
commit d8b6dbfffe
7 changed files with 8 additions and 18 deletions

View File

@ -11,6 +11,9 @@
'focusing' when searching only for filenames.
* src/browser.c (findnextfile, do_filesearch, do_fileresearch):
Greatly simplify the searching for the next matching filename.
* src/{browser,files,help,prompt,text,winio}.c: Let the function
bottombars() set the global variable 'currmenu' -- the displayed
menu must necessarily be the active one.
2015-04-05 Benno Schulenberg <bensberg@justemail.net>
* doc/texinfo/nano.texi: Expand on nano's features, condense the

View File

@ -60,7 +60,6 @@ char *do_browser(char *path, DIR *dir)
curs_set(0);
blank_statusbar();
currmenu = MBROWSER;
bottombars(MBROWSER);
wnoutrefresh(bottomwin);
@ -197,7 +196,6 @@ char *do_browser(char *path, DIR *dir)
browser_refresh, _("Go To Directory"));
curs_set(0);
currmenu = MBROWSER;
bottombars(MBROWSER);
/* If the directory begins with a newline (i.e. an
@ -823,7 +821,6 @@ void findnextfile(const char *needle)
* shortcut list to the browser shortcut list, and displaying it. */
void filesearch_abort(void)
{
currmenu = MBROWSER;
bottombars(MBROWSER);
}

View File

@ -1049,8 +1049,6 @@ void do_insertfile(
bool right_side_up = FALSE, single_line = FALSE;
#endif
currmenu = MINSERTFILE;
while (TRUE) {
#ifndef NANO_TINY
if (execute) {
@ -2252,8 +2250,6 @@ bool do_writeout(bool exiting)
#endif
bool retval = FALSE;
currmenu = MWRITEFILE;
if (exiting && openfile->filename[0] != '\0' && ISSET(TEMP_FILE)) {
retval = write_file(openfile->filename, NULL, FALSE, OVERWRITE,
FALSE);

View File

@ -62,10 +62,6 @@ void do_help(void (*refresh_func)(void))
assert(help_text != NULL);
/* Set currmenu to allow clicking on the help screen's shortcut
* list, after help_init() is called. */
currmenu = MHELP;
if (ISSET(NO_HELP)) {
/* Make sure that the help screen's shortcut list will actually
* be displayed. */
@ -158,15 +154,14 @@ void do_help(void (*refresh_func)(void))
}
}
currmenu = oldmenu;
if (old_no_help) {
blank_bottombars();
wnoutrefresh(bottomwin);
currmenu = oldmenu;
SET(NO_HELP);
window_init();
} else
bottombars(currmenu);
bottombars(oldmenu);
curs_set(1);
refresh_func();

View File

@ -969,7 +969,6 @@ int do_prompt(bool allow_tabs,
prompt = charalloc(((COLS - 4) * mb_cur_max()) + 1);
currmenu = menu;
bottombars(menu);
va_start(ap, msg);

View File

@ -2213,7 +2213,6 @@ void do_justify(bool full_justify)
/* Display the shortcut list with UnJustify. */
uncutfunc->desc = unjust_tag;
currmenu = MMAIN;
display_main_list();
/* Now get a keystroke and see if it's unjustify. If not, put back
@ -2914,7 +2913,6 @@ void do_spell(void)
/* Cleanup things to do after leaving the linter. */
void lint_cleanup(void)
{
currmenu = MMAIN;
display_main_list();
}
@ -3129,7 +3127,6 @@ void do_linter(void)
return;
}
currmenu = MLINTER;
bottombars(MLINTER);
tmplint = NULL;
curlint = lints;

View File

@ -2344,6 +2344,9 @@ void bottombars(int menu)
subnfunc *f;
const sc *s;
/* Set the global variable to the given menu. */
currmenu = menu;
if (ISSET(NO_HELP))
return;