From: Benno Schulenberg Date: Fri, 27 Jun 2014 20:01:27 +0000 (+0000) Subject: Normalizing some indentation and whitespace. X-Git-Tag: v2.3.5~35 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=26de2dd843a099c8a820fcfa44300da4e0bd7423;p=nano.git Normalizing some indentation and whitespace. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5025 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 4caa05df..e0503530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ Remove these functions and thus the ability to search for a matching bracket in a prompt input line. The find_bracket function never had a default keybinding outside MMAIN, so is unlikely to have been used. + * src/prompt.c (do_statusbar_input): Normalize the indentation. + * src/winio.c: Normalize some whitespace. 2014-06-25 Benno Schulenberg * src/browser.c (do_browser): Allow 'firstfile' and 'lastfile' to be diff --git a/src/prompt.c b/src/prompt.c index d755bfe5..c33dca34 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -156,7 +156,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, ; else if (s->scfunc == total_refresh) total_statusbar_refresh(refresh_func); - else if (s->scfunc == do_cut_text_void) { + else if (s->scfunc == do_cut_text_void) { /* If we're using restricted mode, the filename * isn't blank, and we're at the "Write File" * prompt, disable Cut. */ @@ -167,39 +167,36 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, do_statusbar_right(); else if (s->scfunc == do_left) do_statusbar_left(); - #ifndef NANO_TINY else if (s->scfunc == do_next_word_void) do_statusbar_next_word(FALSE); else if (s->scfunc == do_prev_word_void) - do_statusbar_prev_word(FALSE); + do_statusbar_prev_word(FALSE); #endif else if (s->scfunc == do_home) - do_statusbar_home(); + do_statusbar_home(); else if (s->scfunc == do_end) - do_statusbar_end(); + do_statusbar_end(); else if (s->scfunc == do_verbatim_input) { - /* If we're using restricted mode, the filename - * isn't blank, and we're at the "Write File" - * prompt, disable verbatim input. */ - if (!ISSET(RESTRICTED) || - openfile->filename[0] == '\0' || - currmenu != MWRITEFILE) { - bool got_enter; - /* Whether we got the Enter key. */ - - do_statusbar_verbatim_input(&got_enter); - - /* If we got the Enter key, remove it from - * the input buffer, set input to the key - * value for Enter, and set finished to TRUE - * to indicate that we're done. */ - if (got_enter) { - get_input(NULL, 1); - input = sc_seq_or(do_enter_void, 0); - *finished = TRUE; - } + /* If we're using restricted mode, the filename + * isn't blank, and we're at the "Write File" + * prompt, disable verbatim input. */ + if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE || + openfile->filename[0] == '\0') { + bool got_enter; + /* Whether we got the Enter key. */ + + do_statusbar_verbatim_input(&got_enter); + + /* If we got the Enter key, remove it from the input + * buffer, set input to the key value for Enter, and + * set finished to TRUE to indicate that we're done. */ + if (got_enter) { + get_input(NULL, 1); + input = sc_seq_or(do_enter_void, 0); + *finished = TRUE; } + } } else if (s->scfunc == do_delete) { /* If we're using restricted mode, the filename * isn't blank, and we're at the "Write File" @@ -224,7 +221,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, if (s->scfunc != 0 && s->execute == TRUE) { *ran_func = TRUE; if (f && (!ISSET(VIEW_MODE) || (f->viewok))) - f->scfunc(); + f->scfunc(); } *finished = TRUE; } diff --git a/src/winio.c b/src/winio.c index c8d56bcc..6c9ba526 100644 --- a/src/winio.c +++ b/src/winio.c @@ -124,7 +124,7 @@ void get_key_buffer(WINDOW *win) errcount = 0; if (nodelay_mode) { if ((input = wgetch(win)) == ERR) - return; + return; } else while ((input = wgetch(win)) == ERR) { errcount++; @@ -1696,14 +1696,14 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) /* Go through the list of functions to determine which * shortcut in the current menu we released/clicked on. */ for (f = allfuncs; f != NULL; f = f->next) { - if ((f->menus & currmenu) == 0) + if ((f->menus & currmenu) == 0) continue; #ifndef DISABLE_HELP if (!f->help || strlen(f->help) == 0) continue; #endif if (first_sc_for(currmenu, f->scfunc) == NULL) - continue; + continue; /* Tick off an actually shown shortcut. */ j -= 1; if (j == 0) @@ -1715,7 +1715,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) /* And put the corresponding key into the keyboard buffer. */ if (f != NULL) { - const sc *s = first_sc_for(currmenu, f->scfunc); + const sc *s = first_sc_for(currmenu, f->scfunc); unget_kbinput(s->seq, s->type == META, s->type == FKEY); } return 1; @@ -1774,7 +1774,7 @@ const sc *get_shortcut(int menu, int *kbinput, bool *meta_key) #endif for (s = sclist; s != NULL; s = s->next) { - if ((menu & s->menu) && *kbinput == s->seq + if ((menu & s->menu) && *kbinput == s->seq && *meta_key == (s->type == META)) { #ifdef DEBUG fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n", @@ -2250,12 +2250,12 @@ void set_modified(void) if (openfile->filename[0] == '\0') return; else if (openfile->lock_filename == NULL) { - /* TRANSLATORS: Try to keep this at most 76 characters. */ - statusbar(_("Warning: Modifying a file which is not locked, check directory permission?")); + /* TRANSLATORS: Try to keep this at most 76 characters. */ + statusbar(_("Warning: Modifying a file which is not locked, check directory permission?")); } else { write_lockfile(openfile->lock_filename, - get_full_path(openfile->filename), TRUE); - } + get_full_path(openfile->filename), TRUE); + } } #endif } @@ -2367,30 +2367,30 @@ void bottombars(int menu) for (f = allfuncs, i = 0; i < slen && f != NULL; f = f->next) { #ifdef DEBUG - fprintf(stderr, "Checking menu items...."); + fprintf(stderr, "Checking menu items...."); #endif - if ((f->menus & menu) == 0) + if ((f->menus & menu) == 0) continue; - if (!f->desc || strlen(f->desc) == 0) + if (!f->desc || strlen(f->desc) == 0) continue; #ifdef DEBUG - fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc); + fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc); #endif - s = first_sc_for(menu, f->scfunc); - if (s == NULL) { + s = first_sc_for(menu, f->scfunc); + if (s == NULL) { #ifdef DEBUG fprintf(stderr, "Whoops, guess not, no shortcut key found for func!\n"); #endif - continue; - } + continue; + } wmove(bottomwin, 1 + i % 2, (i / 2) * colwidth); #ifdef DEBUG - fprintf(stderr, "Calling onekey with keystr \"%s\" and desc \"%s\"\n", s->keystr, f->desc); + fprintf(stderr, "Calling onekey with keystr \"%s\" and desc \"%s\"\n", s->keystr, f->desc); #endif onekey(s->keystr, _(f->desc), colwidth + (COLS % colwidth)); - i++; + i++; } wnoutrefresh(bottomwin);