Adjusting some indentation and some line wrapping.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5593 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
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>
* 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 <bensberg@justemail.net>
* 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
* 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);
}

View File

@ -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

View File

@ -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