Adjusting some indentation and some line wrapping.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5593 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2016-01-26 09:16:09 +00:00
parent 7256b055b1
commit 65c7c810bc
4 changed files with 29 additions and 34 deletions

View File

@ -1,6 +1,7 @@
2016-01-26 Benno Schulenberg <bensberg@justemail.net> 2016-01-26 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (update_poshistory): Do not add directories to the * src/files.c (update_poshistory): Do not add directories to the
list of file positions. This fixes Savannah bug #46971. list of file positions. This fixes Savannah bug #46971.
* src/*.c: Adjust some indentation and some line wrapping.
2016-01-25 Benno Schulenberg <bensberg@justemail.net> 2016-01-25 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (update_poshistory): Handle an update of the first * src/files.c (update_poshistory): Handle an update of the first

View File

@ -151,8 +151,8 @@ int do_statusbar_input(bool *ran_func, bool *finished,
/* If we're using restricted mode, the filename /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
* prompt, disable Cut. */ * prompt, disable Cut. */
if (!ISSET(RESTRICTED) || openfile->filename[0] == if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
'\0' || currmenu != MWRITEFILE) currmenu != MWRITEFILE)
do_statusbar_cut_text(); do_statusbar_cut_text();
} else if (s->scfunc == do_left) } else if (s->scfunc == do_left)
do_statusbar_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 /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
* prompt, disable Delete. */ * prompt, disable Delete. */
if (!ISSET(RESTRICTED) || openfile->filename[0] == if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
'\0' || currmenu != MWRITEFILE) currmenu != MWRITEFILE)
do_statusbar_delete(); do_statusbar_delete();
} else if (s->scfunc == do_backspace) { } else if (s->scfunc == do_backspace) {
/* If we're using restricted mode, the filename /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
* prompt, disable Backspace. */ * prompt, disable Backspace. */
if (!ISSET(RESTRICTED) || openfile->filename[0] == if (!ISSET(RESTRICTED) || openfile->filename[0] == '\0' ||
'\0' || currmenu != MWRITEFILE) currmenu != MWRITEFILE)
do_statusbar_backspace(); do_statusbar_backspace();
} else { } else {
/* Handle any other shortcut in the current menu, setting /* Handle any other shortcut in the current menu, setting
@ -660,8 +660,7 @@ void update_the_bar(void)
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
} }
/* Get a string of input at the statusbar prompt. This should only be /* Get a string of input at the statusbar prompt. */
* called from do_prompt(). */
functionptrtype get_prompt_string(int *actual, bool allow_tabs, functionptrtype get_prompt_string(int *actual, bool allow_tabs,
#ifndef DISABLE_TABCOMP #ifndef DISABLE_TABCOMP
bool allow_files, bool allow_files,
@ -723,13 +722,12 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
assert(statusbar_x <= strlen(answer)); assert(statusbar_x <= strlen(answer));
#ifndef NANO_TINY #ifndef NANO_TINY
if (kbinput == KEY_WINCH) { if (kbinput == KEY_WINCH) {
refresh_func(); refresh_func();
update_statusbar_line(answer, statusbar_x); update_statusbar_line(answer, statusbar_x);
continue; continue;
} }
#endif #endif
func = func_from_key(&kbinput); func = func_from_key(&kbinput);
if (func == do_cancel || func == do_enter) 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, * history list, answer is blank, and magichistory is set,
* save magichistory in answer. */ * save magichistory in answer. */
if ((*history_list)->next == NULL && if ((*history_list)->next == NULL &&
*answer == '\0' && magichistory != 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);
@ -830,7 +828,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
#if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP) #if !defined(DISABLE_HISTORIES) && !defined(DISABLE_TABCOMP)
last_kbinput = kbinput; last_kbinput = kbinput;
#endif #endif
reset_statusbar_cursor(); reset_statusbar_cursor();
wnoutrefresh(bottomwin); wnoutrefresh(bottomwin);
} }

View File

@ -463,10 +463,9 @@ void do_search(void)
/* If we found something, and we're back at the exact same spot where /* If we found something, and we're back at the exact same spot where
* we started searching, then this is the only occurrence. */ * we started searching, then this is the only occurrence. */
if (fileptr == openfile->current && fileptr_x == if (didfind && fileptr == openfile->current &&
openfile->current_x && didfind) { fileptr_x == openfile->current_x)
statusbar(_("This is the only occurrence")); statusbar(_("This is the only occurrence"));
}
openfile->placewewant = xplustabs(); openfile->placewewant = xplustabs();
edit_redraw(fileptr, pww_save); edit_redraw(fileptr, pww_save);
@ -516,7 +515,9 @@ void do_research(void)
last_search = mallocstrcpy(last_search, searchbot->prev->data); last_search = mallocstrcpy(last_search, searchbot->prev->data);
#endif #endif
if (last_search[0] != '\0') { if (last_search[0] == '\0')
statusbar(_("No current search pattern"));
else {
#ifdef HAVE_REGEX_H #ifdef HAVE_REGEX_H
/* Since answer is "", use last_search! */ /* Since answer is "", use last_search! */
if (ISSET(USE_REGEXP) && !regexp_init(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 /* If we found something, and we're back at the exact same spot
* where we started searching, then this is the only occurrence. */ * where we started searching, then this is the only occurrence. */
if (fileptr == openfile->current && fileptr_x == if (didfind && fileptr == openfile->current &&
openfile->current_x && didfind) { fileptr_x == openfile->current_x && didfind)
statusbar(_("This is the only occurrence")); statusbar(_("This is the only occurrence"));
} }
} else
statusbar(_("No current search pattern"));
openfile->placewewant = xplustabs(); openfile->placewewant = xplustabs();
edit_redraw(fileptr, pww_save); edit_redraw(fileptr, pww_save);
@ -805,8 +804,7 @@ ssize_t do_replace_loop(
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
/* If color syntaxes are available and turned on, we /* If color syntaxes are available and turned on, we
* need to call edit_refresh(). */ * need to call edit_refresh(). */
if (openfile->colorstrings != NULL && if (openfile->colorstrings != NULL && !ISSET(NO_COLOR_SYNTAX))
!ISSET(NO_COLOR_SYNTAX))
edit_refresh(); edit_refresh();
else else
#endif #endif

View File

@ -2800,8 +2800,7 @@ bool need_screen_update(size_t pww_save)
#ifndef NANO_TINY #ifndef NANO_TINY
openfile->mark_set || openfile->mark_set ||
#endif #endif
get_page_start(pww_save) != get_page_start(pww_save) != get_page_start(openfile->placewewant);
get_page_start(openfile->placewewant);
} }
/* When edittop changes, try and figure out how many lines /* When edittop changes, try and figure out how many lines