From: Benno Schulenberg Date: Tue, 26 Jan 2016 09:16:09 +0000 (+0000) Subject: Adjusting some indentation and some line wrapping. X-Git-Tag: v2.5.2~42 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=65c7c810bc0502973ee3d59cefb3adfc62cd23ab;p=nano.git Adjusting some indentation and some line wrapping. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5593 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index e69e31dc..567dba1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2016-01-26 Benno Schulenberg * src/files.c (update_poshistory): Do not add directories to the list of file positions. This fixes Savannah bug #46971. + * src/*.c: Adjust some indentation and some line wrapping. 2016-01-25 Benno Schulenberg * src/files.c (update_poshistory): Handle an update of the first diff --git a/src/prompt.c b/src/prompt.c index a49bb5b8..bc7c43c8 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -151,8 +151,8 @@ int do_statusbar_input(bool *ran_func, bool *finished, /* If we're using restricted mode, the filename * isn't blank, and we're at the "Write File" * prompt, disable Cut. */ - if (!ISSET(RESTRICTED) || openfile->filename[0] == - '\0' || currmenu != MWRITEFILE) + if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' || + currmenu != MWRITEFILE) do_statusbar_cut_text(); } else if (s->scfunc == do_left) do_statusbar_left(); @@ -192,15 +192,15 @@ int do_statusbar_input(bool *ran_func, bool *finished, /* If we're using restricted mode, the filename * isn't blank, and we're at the "Write File" * prompt, disable Delete. */ - if (!ISSET(RESTRICTED) || openfile->filename[0] == - '\0' || currmenu != MWRITEFILE) + if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' || + currmenu != MWRITEFILE) do_statusbar_delete(); } else if (s->scfunc == do_backspace) { /* If we're using restricted mode, the filename * isn't blank, and we're at the "Write File" * prompt, disable Backspace. */ - if (!ISSET(RESTRICTED) || openfile->filename[0] == - '\0' || currmenu != MWRITEFILE) + if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' || + currmenu != MWRITEFILE) do_statusbar_backspace(); } else { /* Handle any other shortcut in the current menu, setting @@ -660,8 +660,7 @@ void update_the_bar(void) update_statusbar_line(answer, statusbar_x); } -/* Get a string of input at the statusbar prompt. This should only be - * called from do_prompt(). */ +/* Get a string of input at the statusbar prompt. */ functionptrtype get_prompt_string(int *actual, bool allow_tabs, #ifndef DISABLE_TABCOMP bool allow_files, @@ -723,13 +722,12 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, assert(statusbar_x <= strlen(answer)); #ifndef NANO_TINY - if (kbinput == KEY_WINCH) { - refresh_func(); - update_statusbar_line(answer, statusbar_x); - continue; - } + if (kbinput == KEY_WINCH) { + refresh_func(); + update_statusbar_line(answer, statusbar_x); + continue; + } #endif - func = func_from_key(&kbinput); if (func == do_cancel || func == do_enter) @@ -796,10 +794,10 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, * 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); - statusbar_x = strlen(answer); - } + *answer == '\0' && magichistory != NULL) { + answer = mallocstrcpy(answer, magichistory); + statusbar_x = strlen(answer); + } update_statusbar_line(answer, statusbar_x); @@ -830,7 +828,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs, #if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP) last_kbinput = kbinput; #endif - reset_statusbar_cursor(); wnoutrefresh(bottomwin); } diff --git a/src/search.c b/src/search.c index c1f84fc1..45164b26 100644 --- a/src/search.c +++ b/src/search.c @@ -463,10 +463,9 @@ void do_search(void) /* If we found something, and we're back at the exact same spot where * we started searching, then this is the only occurrence. */ - if (fileptr == openfile->current && fileptr_x == - openfile->current_x && didfind) { - statusbar(_("This is the only occurrence")); - } + if (didfind && fileptr == openfile->current && + fileptr_x == openfile->current_x) + statusbar(_("This is the only occurrence")); openfile->placewewant = xplustabs(); edit_redraw(fileptr, pww_save); @@ -516,7 +515,9 @@ void do_research(void) last_search = mallocstrcpy(last_search, searchbot->prev->data); #endif - if (last_search[0] != '\0') { + if (last_search[0] == '\0') + statusbar(_("No current search pattern")); + else { #ifdef HAVE_REGEX_H /* Since answer is "", use last_search! */ if (ISSET(USE_REGEXP) && !regexp_init(last_search)) @@ -532,12 +533,10 @@ void do_research(void) /* If we found something, and we're back at the exact same spot * where we started searching, then this is the only occurrence. */ - if (fileptr == openfile->current && fileptr_x == - openfile->current_x && didfind) { - statusbar(_("This is the only occurrence")); - } - } else - statusbar(_("No current search pattern")); + if (didfind && fileptr == openfile->current && + fileptr_x == openfile->current_x && didfind) + statusbar(_("This is the only occurrence")); + } openfile->placewewant = xplustabs(); edit_redraw(fileptr, pww_save); @@ -805,8 +804,7 @@ ssize_t do_replace_loop( #ifndef DISABLE_COLOR /* If color syntaxes are available and turned on, we * need to call edit_refresh(). */ - if (openfile->colorstrings != NULL && - !ISSET(NO_COLOR_SYNTAX)) + if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX)) edit_refresh(); else #endif diff --git a/src/winio.c b/src/winio.c index 9d4c0346..51a9ee0a 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2800,8 +2800,7 @@ bool need_screen_update(size_t pww_save) #ifndef NANO_TINY openfile->mark_set || #endif - get_page_start(pww_save) != - get_page_start(openfile->placewewant); + get_page_start(pww_save) != get_page_start(openfile->placewewant); } /* When edittop changes, try and figure out how many lines