From cf9f32b009eb5080b8390d7459e960836c4bd46a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 31 Jul 2014 20:49:32 +0000 Subject: [PATCH] Reordering a few things, and adjusting some whitespace. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5086 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ src/browser.c | 9 ++++----- src/prompt.c | 24 ++++++++++-------------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1942a904..0d165056 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2014-07-31 Benno Schulenberg * src/files.c (do_insertfile): Adjust some indentation. + * src/prompt.c (do_statusbar_input), src/browser.c (do_browser): + Reorder a few things, and adjust some whitespace. 2014-07-27 Benno Schulenberg * src/global.c (add_to_sclist): Remove the now unused and unneeded diff --git a/src/browser.c b/src/browser.c index bdbd9b0f..12716a03 100644 --- a/src/browser.c +++ b/src/browser.c @@ -268,12 +268,12 @@ char *do_browser(char *path, DIR *dir) } else if (func == do_up_void) { if (selected >= width) selected -= width; - } else if (func == do_left) { - if (selected > 0) - selected--; } else if (func == do_down_void) { if (selected + width <= filelist_len - 1) selected += width; + } else if (func == do_left) { + if (selected > 0) + selected--; } else if (func == do_right) { if (selected < filelist_len - 1) selected++; @@ -581,8 +581,7 @@ void browser_refresh(void) /* The maximum length of the file information in * columns: seven for "--", "(dir)", or the file size, * and 12 for "(parent dir)". */ - bool dots = (COLS >= 15 && filetaillen >= longest - - foomaxlen - 1); + bool dots = (COLS >= 15 && filetaillen >= longest - foomaxlen - 1); /* Do we put an ellipsis before the filename? Don't set * this to TRUE if we have fewer than 15 columns (i.e. * one column for padding, plus seven columns for a diff --git a/src/prompt.c b/src/prompt.c index 6a1e99f1..0729dc2f 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -151,15 +151,15 @@ int do_statusbar_input(bool *ran_func, bool *finished, if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' || currmenu != MWRITEFILE) do_statusbar_cut_text(); - } else if (s->scfunc == do_right) - do_statusbar_right(); - else if (s->scfunc == do_left) + } else if (s->scfunc == do_left) do_statusbar_left(); + else if (s->scfunc == do_right) + do_statusbar_right(); #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); + else if (s->scfunc == do_next_word_void) + do_statusbar_next_word(FALSE); #endif else if (s->scfunc == do_home) do_statusbar_home(); @@ -340,13 +340,12 @@ void do_statusbar_home(void) statusbar_x = 0; statusbar_pww = statusbar_xplustabs(); - } else { + } else #endif + { statusbar_x = 0; statusbar_pww = statusbar_xplustabs(); -#ifndef NANO_TINY } -#endif if (need_statusbar_horizontal_update(pww_save)) update_statusbar_line(answer, statusbar_x); @@ -431,14 +430,13 @@ void do_statusbar_cut_text(void) #ifndef NANO_TINY if (ISSET(CUT_TO_END)) null_at(&answer, statusbar_x); - else { + else #endif + { null_at(&answer, 0); statusbar_x = 0; statusbar_pww = statusbar_xplustabs(); -#ifndef NANO_TINY } -#endif update_statusbar_line(answer, statusbar_x); } @@ -777,7 +775,7 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, } #ifdef DEBUG -fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x); + fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answer, (unsigned long) statusbar_x); #endif update_statusbar_line(answer, statusbar_x); @@ -901,7 +899,6 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe wnoutrefresh(bottomwin); } - #ifndef DISABLE_HISTORIES /* Set the current position in the history list to the bottom, * and free magichistory if we need to. */ @@ -913,7 +910,6 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe } #endif - /* We've finished putting in an answer or run a normal shortcut's * associated function, so reset statusbar_x and statusbar_pww. If * we've finished putting in an answer, reset the statusbar cursor