From 492e9f605b22fa1e08d346536cce941f21b860c3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 20 Jun 2014 10:48:26 +0000 Subject: [PATCH] Miscellaneous whitespace adjustments and comment tweaks. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4995 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 1 + src/browser.c | 327 ++++++++++++++++++++++++-------------------------- src/files.c | 31 ++--- src/global.c | 64 +++++----- src/nano.h | 7 +- src/proto.h | 3 +- src/rcfile.c | 26 ++-- src/winio.c | 8 +- 8 files changed, 231 insertions(+), 236 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7cb46c1..7ad48cc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ unneeded extern, and regroup some stuff. * src/files.c (check_dotnano): Wrap long lines and actually report the name that is not a directory. + * src/*: Miscellaneous whitespace adjustments and comment tweaks. 2014-06-19 Benno Schulenberg * src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()' diff --git a/src/browser.c b/src/browser.c index 77f4ad86..b1e7d725 100644 --- a/src/browser.c +++ b/src/browser.c @@ -128,35 +128,35 @@ char *do_browser(char *path, DIR *dir) #ifndef DISABLE_MOUSE if (kbinput == KEY_MOUSE) { - int mouse_x, mouse_y; - - /* We can click on the edit window to select a - * filename. */ - if (get_mouseinput(&mouse_x, &mouse_y, TRUE) == 0 && - wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) { - /* longest is the width of each column. There - * are two spaces between each column. */ - selected = (fileline / editwinrows) * + int mouse_x, mouse_y; + + /* We can click on the edit window to select a + * filename. */ + if (get_mouseinput(&mouse_x, &mouse_y, TRUE) == 0 && + wmouse_trafo(edit, &mouse_y, &mouse_x, FALSE)) { + /* longest is the width of each column. There + * are two spaces between each column. */ + selected = (fileline / editwinrows) * (editwinrows * width) + (mouse_y * width) + (mouse_x / (longest + 2)); - /* If they clicked beyond the end of a row, - * select the filename at the end of that - * row. */ - if (mouse_x > width * (longest + 2)) - selected--; - - /* If we're off the screen, select the last - * filename. */ - if (selected > filelist_len - 1) - selected = filelist_len - 1; - - /* If we selected the same filename as last - * time, put back the Enter key so that it's - * read in. */ - if (old_selected == selected) - unget_kbinput(sc_seq_or(do_enter_void, 0), FALSE, FALSE); - } + /* If they clicked beyond the end of a row, + * select the filename at the end of that + * row. */ + if (mouse_x > width * (longest + 2)) + selected--; + + /* If we're off the screen, select the last + * filename. */ + if (selected > filelist_len - 1) + selected = filelist_len - 1; + + /* If we selected the same filename as last + * time, put back the Enter key so that it's + * read in. */ + if (old_selected == selected) + unget_kbinput(sc_seq_or(do_enter_void, 0), FALSE, FALSE); + } } #endif /* !DISABLE_MOUSE */ @@ -169,7 +169,7 @@ char *do_browser(char *path, DIR *dir) break; if (f->scfunc == total_refresh) { - total_redraw(); + total_redraw(); } else if (f->scfunc == do_help_void) { #ifndef DISABLE_HELP do_help_void(); @@ -177,37 +177,33 @@ char *do_browser(char *path, DIR *dir) #else nano_disabled_msg(); #endif - /* Search for a filename. */ } else if (f->scfunc == do_search) { - curs_set(1); - do_filesearch(); - curs_set(0); - /* Search for another filename. */ + /* Search for a filename. */ + curs_set(1); + do_filesearch(); + curs_set(0); } else if (f->scfunc == do_research) { - do_fileresearch(); + /* Search for another filename. */ + do_fileresearch(); } else if (f->scfunc == do_page_up) { - if (selected >= (editwinrows + fileline % editwinrows) * - width) - selected -= (editwinrows + fileline % editwinrows) * - width; - else - selected = 0; + if (selected >= (editwinrows + fileline % editwinrows) * width) + selected -= (editwinrows + fileline % editwinrows) * width; + else + selected = 0; } else if (f->scfunc == do_page_down) { - selected += (editwinrows - fileline % editwinrows) * - width; - if (selected > filelist_len - 1) - selected = filelist_len - 1; + selected += (editwinrows - fileline % editwinrows) * width; + if (selected > filelist_len - 1) + selected = filelist_len - 1; } else if (f->scfunc == do_first_file) { - if (meta_key) - selected = 0; + if (meta_key) + selected = 0; } else if (f->scfunc == do_last_file) { - if (meta_key) - selected = filelist_len - 1; - /* Go to a specific directory. */ + if (meta_key) + selected = filelist_len - 1; } else if (f->scfunc == goto_dir_void) { - curs_set(1); - - i = do_prompt(TRUE, + /* Go to a specific directory. */ + curs_set(1); + i = do_prompt(TRUE, #ifndef DISABLE_TABCOMP FALSE, #endif @@ -219,144 +215,141 @@ char *do_browser(char *path, DIR *dir) /* TRANSLATORS: This is a prompt. */ browser_refresh, _("Go To Directory")); - curs_set(0); + curs_set(0); #if !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE) - currmenu = MBROWSER; + currmenu = MBROWSER; #endif - bottombars(MBROWSER); - - /* If the directory begins with a newline (i.e. an - * encoded null), treat it as though it's blank. */ - if (i < 0 || *answer == '\n') { - /* We canceled. Indicate that on the statusbar, and - * blank out ans, since we're done with it. */ - statusbar(_("Cancelled")); - ans = mallocstrcpy(ans, ""); - continue; - } else if (i != 0) { - /* Put back the "Go to Directory" key and save - * answer in ans, so that the file list is displayed - * again, the prompt is displayed again, and what we - * typed before at the prompt is displayed again. */ - unget_kbinput(sc_seq_or(do_gotolinecolumn_void, 0), FALSE, FALSE); - ans = mallocstrcpy(ans, answer); - continue; - } - - /* We have a directory. Blank out ans, since we're done - * with it. */ + bottombars(MBROWSER); + + /* If the directory begins with a newline (i.e. an + * encoded null), treat it as though it's blank. */ + if (i < 0 || *answer == '\n') { + /* We canceled. Indicate that on the statusbar, and + * blank out ans, since we're done with it. */ + statusbar(_("Cancelled")); ans = mallocstrcpy(ans, ""); + continue; + } else if (i != 0) { + /* Put back the "Go to Directory" key and save + * answer in ans, so that the file list is displayed + * again, the prompt is displayed again, and what we + * typed before at the prompt is displayed again. */ + unget_kbinput(sc_seq_or(do_gotolinecolumn_void, 0), FALSE, FALSE); + ans = mallocstrcpy(ans, answer); + continue; + } + + /* We have a directory. Blank out ans, since we're done + * with it. */ + ans = mallocstrcpy(ans, ""); - /* Convert newlines to nulls, just before we go to the - * directory. */ - sunder(answer); - align(&answer); + /* Convert newlines to nulls, just before we go to the + * directory. */ + sunder(answer); + align(&answer); - new_path = real_dir_from_tilde(answer); + new_path = real_dir_from_tilde(answer); - if (new_path[0] != '/') { - new_path = charealloc(new_path, strlen(path) + - strlen(answer) + 1); - sprintf(new_path, "%s%s", path, answer); - } + if (new_path[0] != '/') { + new_path = charealloc(new_path, strlen(path) + + strlen(answer) + 1); + sprintf(new_path, "%s%s", path, answer); + } #ifndef DISABLE_OPERATINGDIR - if (check_operating_dir(new_path, FALSE)) { - statusbar( - _("Can't go outside of %s in restricted mode"), - operating_dir); - free(new_path); - continue; - } + if (check_operating_dir(new_path, FALSE)) { + statusbar(_("Can't go outside of %s in restricted mode"), + operating_dir); + free(new_path); + continue; + } #endif - dir = opendir(new_path); - if (dir == NULL) { - /* We can't open this directory for some reason. - * Complain. */ - statusbar(_("Error reading %s: %s"), answer, - strerror(errno)); - beep(); - free(new_path); - continue; - } - - /* Start over again with the new path value. */ - free(path); - path = new_path; - goto change_browser_directory; + dir = opendir(new_path); + if (dir == NULL) { + /* We can't open this directory for some reason. + * Complain. */ + statusbar(_("Error reading %s: %s"), answer, + strerror(errno)); + beep(); + free(new_path); + continue; + } + + /* Start over again with the new path value. */ + free(path); + path = new_path; + goto change_browser_directory; } else if (f->scfunc == do_up_void) { - if (selected >= width) - selected -= width; + if (selected >= width) + selected -= width; } else if (f->scfunc == do_left) { - if (selected > 0) - selected--; + if (selected > 0) + selected--; } else if (f->scfunc == do_down_void) { - if (selected + width <= filelist_len - 1) - selected += width; + if (selected + width <= filelist_len - 1) + selected += width; } else if (f->scfunc == do_right) { - if (selected < filelist_len - 1) - selected++; + if (selected < filelist_len - 1) + selected++; } else if (f->scfunc == do_enter_void) { - /* We can't move up from "/". */ - if (strcmp(filelist[selected], "/..") == 0) { - statusbar(_("Can't move up a directory")); - beep(); - continue; - } + /* We can't move up from "/". */ + if (strcmp(filelist[selected], "/..") == 0) { + statusbar(_("Can't move up a directory")); + beep(); + continue; + } #ifndef DISABLE_OPERATINGDIR - /* Note: The selected file can be outside the operating - * directory if it's ".." or if it's a symlink to a - * directory outside the operating directory. */ - if (check_operating_dir(filelist[selected], FALSE)) { - statusbar( - _("Can't go outside of %s in restricted mode"), - operating_dir); - beep(); - continue; - } + /* Note: The selected file can be outside the operating + * directory if it's ".." or if it's a symlink to a + * directory outside the operating directory. */ + if (check_operating_dir(filelist[selected], FALSE)) { + statusbar(_("Can't go outside of %s in restricted mode"), + operating_dir); + beep(); + continue; + } #endif - if (stat(filelist[selected], &st) == -1) { - /* We can't open this file for some reason. - * Complain. */ - statusbar(_("Error reading %s: %s"), - filelist[selected], strerror(errno)); - beep(); - continue; - } - - /* If we've successfully opened a file, we're done, so - * get out. */ - if (!S_ISDIR(st.st_mode)) { - retval = mallocstrcpy(NULL, filelist[selected]); - abort = TRUE; - continue; + if (stat(filelist[selected], &st) == -1) { + /* We can't open this file for some reason. + * Complain. */ + statusbar(_("Error reading %s: %s"), + filelist[selected], strerror(errno)); + beep(); + continue; + } + + /* If we've successfully opened a file, we're done, so + * get out. */ + if (!S_ISDIR(st.st_mode)) { + retval = mallocstrcpy(NULL, filelist[selected]); + abort = TRUE; + continue; /* If we've successfully opened a directory, and it's * "..", save the current directory in prev_dir, so that - * we can select it later. */ - } else if (strcmp(tail(filelist[selected]), "..") == 0) - prev_dir = mallocstrcpy(NULL, - striponedir(filelist[selected])); - - dir = opendir(filelist[selected]); - if (dir == NULL) { - /* We can't open this directory for some reason. - * Complain. */ - statusbar(_("Error reading %s: %s"), - filelist[selected], strerror(errno)); - beep(); - continue; - } - - path = mallocstrcpy(path, filelist[selected]); - - /* Start over again with the new path value. */ - goto change_browser_directory; - /* Abort the file browser. */ + * we can easily return to it by hitting Enter. */ + } else if (strcmp(tail(filelist[selected]), "..") == 0) + prev_dir = mallocstrcpy(NULL, striponedir(filelist[selected])); + + dir = opendir(filelist[selected]); + if (dir == NULL) { + /* We can't open this directory for some reason. + * Complain. */ + statusbar(_("Error reading %s: %s"), + filelist[selected], strerror(errno)); + beep(); + continue; + } + + path = mallocstrcpy(path, filelist[selected]); + + /* Start over again with the new path value. */ + goto change_browser_directory; } else if (f->scfunc == do_exit) { - abort = TRUE; + /* Abort the file browser. */ + abort = TRUE; } } titlebar(NULL); diff --git a/src/files.c b/src/files.c index dbf97f62..68354a08 100644 --- a/src/files.c +++ b/src/files.c @@ -1278,7 +1278,7 @@ void do_insertfile( void do_insertfile_void(void) { if (ISSET(RESTRICTED)) { - nano_disabled_msg(); + nano_disabled_msg(); return; } @@ -2410,8 +2410,10 @@ bool do_writeout(bool exiting) /* Complain if the file exists, the name hasn't changed, * and the stat information we had before does not match * what we have now. */ - else if (name_exists && openfile->current_stat && (openfile->current_stat->st_mtime < st.st_mtime || - openfile->current_stat->st_dev != st.st_dev || openfile->current_stat->st_ino != st.st_ino)) { + else if (name_exists && openfile->current_stat && + (openfile->current_stat->st_mtime < st.st_mtime || + openfile->current_stat->st_dev != st.st_dev || + openfile->current_stat->st_ino != st.st_ino)) { i = do_yesno_prompt(FALSE, _("File was modified since you opened it, continue saving ? ")); if (i == 0 || i == -1) @@ -2931,7 +2933,7 @@ char *poshistfilename(void) void history_error(const char *msg, ...) { - va_list ap; + va_list ap; va_start(ap, msg); vfprintf(stderr, _(msg), ap); @@ -3103,7 +3105,7 @@ void save_poshistory(void) * history file. */ chmod(poshist, S_IRUSR | S_IWUSR); - for (posptr = poshistory; posptr != NULL; posptr = posptr->next) { + for (posptr = poshistory; posptr != NULL; posptr = posptr->next) { statusstr = charalloc(strlen(posptr->filename) + 2 * sizeof(ssize_t) + 4); sprintf(statusstr, "%s %ld %ld\n", posptr->filename, (long)posptr->lineno, (long)posptr->xno); @@ -3122,18 +3124,18 @@ void save_poshistory(void) * and a column. If no entry is found, add a new one at the end. */ void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos) { - poshiststruct *posptr, *posprev = NULL; - char *fullpath = get_full_path(filename); + poshiststruct *posptr, *posprev = NULL; + char *fullpath = get_full_path(filename); if (fullpath == NULL) - return; + return; for (posptr = poshistory; posptr != NULL; posptr = posptr->next) { - if (!strcmp(posptr->filename, fullpath)) { + if (!strcmp(posptr->filename, fullpath)) { posptr->lineno = lineno; posptr->xno = xpos; - return; - } + return; + } posprev = posptr; } @@ -3197,15 +3199,15 @@ void load_poshistory(void) ssize_t read, lineno, xno; poshiststruct *posptr; - /* See if we can find the file we're currently editing. */ + /* Read and parse each line, and put the data into the + * positions history structure. */ while ((read = getline(&line, &buf_len, hist)) >= 0) { if (read > 0 && line[read - 1] == '\n') { read--; line[read] = '\0'; } - if (read > 0) { + if (read > 0) unsunder(line, read); - } lineptr = parse_next_word(line); xptr = parse_next_word(lineptr); lineno = atoi(lineptr); @@ -3225,7 +3227,6 @@ void load_poshistory(void) posptr->next->xno = xno; posptr->next->next = NULL; } - } fclose(hist); diff --git a/src/global.c b/src/global.c index bf6a36b1..cd97dd83 100644 --- a/src/global.c +++ b/src/global.c @@ -377,9 +377,8 @@ void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void)) sc *s; for (s = sclist; s != NULL; s = s->next) - if (s->scfunc == oldfunc) { + if (s->scfunc == oldfunc) s->scfunc = newfunc; - } } /* Return the given menu's first shortcut sequence, or the default value @@ -1199,7 +1198,7 @@ const subnfunc *sctofunc(sc *s) * for each flag. */ const char *flagtostr(int flag) { - switch (flag) { + switch (flag) { case NO_HELP: /* TRANSLATORS: The next seventeen strings are toggle descriptions; * they are best kept shorter than 40 characters, but may be longer. */ @@ -1326,91 +1325,92 @@ sc *strtosc(char *input) s->scfunc = do_wordlinechar_count; else if (!strcasecmp(input, "undo")) s->scfunc = do_undo; - else if (!strcasecmp(input, "redo")) + else if (!strcasecmp(input, "redo")) { s->scfunc = do_redo; +#endif #ifndef DISABLE_HISTORIES - else if (!strcasecmp(input, "prevhistory")) { - s->scfunc = get_history_older_void; + } else if (!strcasecmp(input, "prevhistory")) { + s->scfunc = get_history_older_void; s->execute = FALSE; } else if (!strcasecmp(input, "nexthistory")) { - s->scfunc = get_history_newer_void; + s->scfunc = get_history_newer_void; s->execute = FALSE; - } #endif - else if (!strcasecmp(input, "nohelp")) { - s->scfunc = do_toggle_void; +#ifndef NANO_TINY + } else if (!strcasecmp(input, "nohelp")) { + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_HELP; } else if (!strcasecmp(input, "constupdate")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = CONST_UPDATE; } else if (!strcasecmp(input, "morespace")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = MORE_SPACE; } else if (!strcasecmp(input, "smoothscroll")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = SMOOTH_SCROLL; } else if (!strcasecmp(input, "softwrap")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = SOFTWRAP; } else if (!strcasecmp(input, "whitespacedisplay")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = WHITESPACE_DISPLAY; #ifndef DISABLE_COLOR } else if (!strcasecmp(input, "nosyntax")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_COLOR_SYNTAX; #endif } else if (!strcasecmp(input, "smarthome")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = SMART_HOME; } else if (!strcasecmp(input, "autoindent")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = AUTOINDENT; } else if (!strcasecmp(input, "cuttoend")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = CUT_TO_END; #ifndef DISABLE_WRAPPING } else if (!strcasecmp(input, "nowrap")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_WRAP; #endif } else if (!strcasecmp(input, "tabstospaces")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = TABS_TO_SPACES; } else if (!strcasecmp(input, "backupfile")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = BACKUP_FILE; #ifndef DISABLE_MULTIBUFFER } else if (!strcasecmp(input, "multibuffer")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = MULTIBUFFER; #endif #ifndef DISABLE_MOUSE } else if (!strcasecmp(input, "mouse")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = USE_MOUSE; #endif } else if (!strcasecmp(input, "noconvert")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = NO_CONVERT; } else if (!strcasecmp(input, "suspendenable")) { - s->scfunc = do_toggle_void; + s->scfunc = do_toggle_void; s->execute = FALSE; s->toggle = SUSPEND; } @@ -1489,16 +1489,16 @@ sc *strtosc(char *input) s->scfunc = dos_format_void; s->execute = FALSE; } else if (!strcasecmp(input, "macformat")) { - s->scfunc = mac_format_void; + s->scfunc = mac_format_void; s->execute = FALSE; } else if (!strcasecmp(input, "append")) { - s->scfunc = append_void; + s->scfunc = append_void; s->execute = FALSE; } else if (!strcasecmp(input, "prepend")) { - s->scfunc = prepend_void; + s->scfunc = prepend_void; s->execute = FALSE; } else if (!strcasecmp(input, "backup")) { - s->scfunc = backup_file_void; + s->scfunc = backup_file_void; s->execute = FALSE; #ifndef ENABLE_TINY } else if (!strcasecmp(input, "flipexecute")) { @@ -1507,12 +1507,12 @@ sc *strtosc(char *input) #endif #ifndef DISABLE_MULTIBUFFER } else if (!strcasecmp(input, "newbuffer")) { - s->scfunc = new_buffer_void; + s->scfunc = new_buffer_void; s->execute = FALSE; #endif #ifndef DISABLE_BROWSER } else if (!strcasecmp(input, "firstfile")) { - s->scfunc = do_first_file; + s->scfunc = do_first_file; s->execute = FALSE; } else if (!strcasecmp(input, "lastfile")) { s->scfunc = do_last_file; diff --git a/src/nano.h b/src/nano.h index 3494b68f..e37d670e 100644 --- a/src/nano.h +++ b/src/nano.h @@ -31,8 +31,8 @@ #ifdef NEED_XOPEN_SOURCE_EXTENDED #ifndef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 -#endif /* _XOPEN_SOURCE_EXTENDED */ -#endif /* NEED_XOPEN_SOURCE_EXTENDED */ +#endif +#endif #ifdef __TANDEM /* Tandem NonStop Kernel support. */ @@ -440,7 +440,6 @@ typedef struct rcoption { long flag; /* The flag associated with it, if any. */ } rcoption; - #endif typedef struct sc { @@ -568,7 +567,7 @@ enum #ifndef NANO_TINY /* Extra bits for the undo function. */ #define UNdel_del (1<<0) -#define UNdel_backspace (1<<1) +#define UNdel_backspace (1<<1) #define UNcut_marked_backwards (1<<2) #define UNcut_cutline (1<<3) #endif /* !NANO_TINY */ diff --git a/src/proto.h b/src/proto.h index a525ba6a..44a4dd00 100644 --- a/src/proto.h +++ b/src/proto.h @@ -79,7 +79,8 @@ extern char *quoteerr; #else extern size_t quotelen; #endif -#endif +#endif /* !DISABLE_JUSTIFY */ + extern bool nodelay_mode; extern char *answer; diff --git a/src/rcfile.c b/src/rcfile.c index ab0cba75..4ffd7ed4 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -766,8 +766,8 @@ void parse_colors(char *ptr, bool icase) 0)) ? mallocstrcpy(NULL, fgstr) : NULL; /* Lame way to skip another static counter. */ - newcolor->id = endsyntax->nmultis; - endsyntax->nmultis++; + newcolor->id = endsyntax->nmultis; + endsyntax->nmultis++; } } } @@ -970,19 +970,19 @@ static void check_vitals_mapped(void) int inmenus[VITALS] = { MMAIN, MHELP, MWHEREIS, MREPLACE, MGOTOLINE }; for (v = 0; v < VITALS; v++) { - for (f = allfuncs; f != NULL; f = f->next) { - if (f->scfunc == vitals[v] && f->menus & inmenus[v]) { - const sc *s = first_sc_for(inmenus[v], f->scfunc); - if (!s) { - fprintf(stderr, _("Fatal error: no keys mapped for function " + for (f = allfuncs; f != NULL; f = f->next) { + if (f->scfunc == vitals[v] && f->menus & inmenus[v]) { + const sc *s = first_sc_for(inmenus[v], f->scfunc); + if (!s) { + fprintf(stderr, _("Fatal error: no keys mapped for function " "\"%s\". Exiting.\n"), f->desc); - fprintf(stderr, _("If needed, use nano with the -I option " + fprintf(stderr, _("If needed, use nano with the -I option " "to adjust your nanorc settings.\n")); - exit(1); - } - break; - } - } + exit(1); + } + break; + } + } } } diff --git a/src/winio.c b/src/winio.c index 87aad692..edd12b8b 100644 --- a/src/winio.c +++ b/src/winio.c @@ -3386,14 +3386,14 @@ void do_cursorpos_void(void) void enable_nodelay(void) { - nodelay_mode = TRUE; - nodelay(edit, TRUE); + nodelay_mode = TRUE; + nodelay(edit, TRUE); } void disable_nodelay(void) { - nodelay_mode = FALSE; - nodelay(edit, FALSE); + nodelay_mode = FALSE; + nodelay(edit, FALSE); } /* Highlight the current word being replaced or spell checked. We -- 2.39.5