Normalizing the indentation somewhat.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4729 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-04-04 19:26:08 +00:00
parent 062bca7c41
commit 96c95cd6a1
2 changed files with 64 additions and 75 deletions

View File

@ -17,6 +17,7 @@
* src/nano.c (do_mouse): Fix warning with --enable-mouse. * src/nano.c (do_mouse): Fix warning with --enable-mouse.
* src/prompt.c (get_prompt_string): Fix compilation for the * src/prompt.c (get_prompt_string): Fix compilation for the
combination of --enable-tiny with --enable-tabcomp. combination of --enable-tiny with --enable-tabcomp.
* src/prompt.c (get_prompt_string): Normalize the indentation.
2014-04-03 Benno Schulenberg <bensberg@justemail.net> 2014-04-03 Benno Schulenberg <bensberg@justemail.net>
* configure.ac: Remove unused '*_support' variables. * configure.ac: Remove unused '*_support' variables.

View File

@ -988,101 +988,89 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe
if (s && s->scfunc == do_tab) { if (s && s->scfunc == do_tab) {
#ifndef NANO_TINY #ifndef NANO_TINY
if (history_list != NULL) { if (history_list != NULL) {
if (last_kbinput != sc_seq_or(do_tab, NANO_CONTROL_I)) if (last_kbinput != sc_seq_or(do_tab, NANO_CONTROL_I))
complete_len = strlen(answer); complete_len = strlen(answer);
if (complete_len > 0) { if (complete_len > 0) {
answer = mallocstrcpy(answer, answer = mallocstrcpy(answer,
get_history_completion(history_list, get_history_completion(history_list,
answer, complete_len)); answer, complete_len));
statusbar_x = strlen(answer); statusbar_x = strlen(answer);
} }
} else } else
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
if (allow_tabs) if (allow_tabs)
answer = input_tab(answer, allow_files, answer = input_tab(answer, allow_files, &statusbar_x,
&statusbar_x, &tabbed, refresh_func, list); &tabbed, refresh_func, list);
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
} else } else
#endif /* !DISABLE_TABCOMP */ #endif /* !DISABLE_TABCOMP */
#ifndef NANO_TINY #ifndef NANO_TINY
if (s && s->scfunc == get_history_older_void) { if (s && s->scfunc == get_history_older_void) {
if (history_list != NULL) { if (history_list != NULL) {
/* If we're scrolling up at the bottom of the /* If we're scrolling up at the bottom of the history list
* history list and answer isn't blank, save answer * and answer isn't blank, save answer in magichistory. */
* in magichistory. */ if ((*history_list)->next == NULL && answer[0] != '\0')
if ((*history_list)->next == NULL && magichistory = mallocstrcpy(magichistory, answer);
answer[0] != '\0')
magichistory = mallocstrcpy(magichistory,
answer);
/* Get the older search from the history list and /* Get the older search from the history list and save it in
* save it in answer. If there is no older search, * answer. If there is no older search, don't do anything. */
* don't do anything. */ if ((history = get_history_older(history_list)) != NULL) {
if ((history = answer = mallocstrcpy(answer, history);
get_history_older(history_list)) != NULL) { statusbar_x = strlen(answer);
answer = mallocstrcpy(answer, history);
statusbar_x = strlen(answer);
}
update_statusbar_line(answer, statusbar_x);
/* This key has a shortcut list entry when it's used
* to move to an older search, which means that
* finished has been set to TRUE. Set it back to
* FALSE here, so that we aren't kicked out of the
* statusbar prompt. */
finished = FALSE;
} }
} else if (s && s->scfunc == get_history_newer_void) {
if (history_list != NULL) {
/* Get the newer search from the history list and
* save it in answer. If there is no newer search,
* don't do anything. */
if ((history =
get_history_newer(history_list)) != NULL) {
answer = mallocstrcpy(answer, history);
statusbar_x = strlen(answer);
}
/* If, after scrolling down, we're at the bottom of update_statusbar_line(answer, statusbar_x);
* the history list, answer is blank, and
* magichistory is set, save magichistory in /* This key has a shortcut-list entry when it's used to
* answer. */ * move to an older search, which means that finished has
if ((*history_list)->next == NULL && * been set to TRUE. Set it back to FALSE here, so that
*answer == '\0' && magichistory != NULL) { * we aren't kicked out of the statusbar prompt. */
finished = FALSE;
}
} else if (s && s->scfunc == get_history_newer_void) {
if (history_list != NULL) {
/* Get the newer search from the history list and save it in
* answer. If there is no newer search, don't do anything. */
if ((history = get_history_newer(history_list)) != NULL) {
answer = mallocstrcpy(answer, history);
statusbar_x = strlen(answer);
}
/* If, after scrolling down, we're at the bottom of the
* history list, answer is blank, and magichistory is set,
* save magichistory in answer. */
if ((*history_list)->next == NULL &&
*answer == '\0' && magichistory != NULL) {
answer = mallocstrcpy(answer, magichistory); answer = mallocstrcpy(answer, magichistory);
statusbar_x = strlen(answer); statusbar_x = strlen(answer);
} }
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
/* This key has a shortcut list entry when it's used /* This key has a shortcut-list entry when it's used to
* to move to a newer search, which means that * move to a newer search, which means that finished has
* finished has been set to TRUE. Set it back to * been set to TRUE. Set it back to FALSE here, so that
* FALSE here, so that we aren't kicked out of the * we aren't kicked out of the statusbar prompt. */
* statusbar prompt. */ finished = FALSE;
finished = FALSE; }
}
} else } else
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
if (s && s->scfunc == do_help_void) { if (s && s->scfunc == do_help_void) {
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
/* This key has a shortcut list entry when it's used to /* This key has a shortcut-list entry when it's used to go to
* go to the help browser or display a message * the help browser or display a message indicating that help
* indicating that help is disabled, which means that * is disabled, which means that finished has been set to TRUE.
* finished has been set to TRUE. Set it back to FALSE * Set it back to FALSE here, so that we aren't kicked out of
* here, so that we aren't kicked out of the statusbar * the statusbar prompt. */
* prompt. */ finished = FALSE;
finished = FALSE;
} }
/* If we have a shortcut with an associated function, break out /* If we have a shortcut with an associated function, break out if
* if we're finished after running or trying to run the * we're finished after running or trying to run the function. */
* function. */
if (finished) if (finished)
break; break;
@ -1096,8 +1084,8 @@ fprintf(stderr, "get_prompt_string: answer = \"%s\", statusbar_x = %lu\n", answe
#ifndef NANO_TINY #ifndef NANO_TINY
/* Set the current position in the history list to the bottom and /* Set the current position in the history list to the bottom,
* free magichistory, if we need to. */ * and free magichistory if we need to. */
if (history_list != NULL) { if (history_list != NULL) {
history_reset(*history_list); history_reset(*history_list);