Using a 'return' instead of an 'else'.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5754 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
4ddf194004
Коммит
b3b2fa8856
@ -8,6 +8,7 @@
|
|||||||
the items from newest to oldest. This fixes Savannah bug #47205.
|
the items from newest to oldest. This fixes Savannah bug #47205.
|
||||||
* src/files.c (do_writeout): When the name of the file was changed,
|
* src/files.c (do_writeout): When the name of the file was changed,
|
||||||
always ask whether this is okay. This fixes Savannah bug #46894.
|
always ask whether this is okay. This fixes Savannah bug #46894.
|
||||||
|
* src/search.c (do_research): Use 'return' instead of 'else'.
|
||||||
|
|
||||||
2016-03-19 Benno Schulenberg <bensberg@justemail.net>
|
2016-03-19 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/search.c (search_init): Always remember the last typed string,
|
* src/search.c (search_init): Always remember the last typed string,
|
||||||
|
30
src/search.c
30
src/search.c
@ -499,31 +499,31 @@ 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"));
|
statusbar(_("No current search pattern"));
|
||||||
else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_REGEX_H
|
#ifdef HAVE_REGEX_H
|
||||||
/* Since answer is "", use last_search! */
|
if (ISSET(USE_REGEXP) && !regexp_init(last_search))
|
||||||
if (ISSET(USE_REGEXP) && !regexp_init(last_search))
|
return;
|
||||||
return;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Use the search-menu key bindings, to allow cancelling. */
|
/* Use the search-menu key bindings, to allow cancelling. */
|
||||||
currmenu = MWHEREIS;
|
currmenu = MWHEREIS;
|
||||||
|
|
||||||
findnextstr_wrap_reset();
|
findnextstr_wrap_reset();
|
||||||
didfind = findnextstr(
|
didfind = findnextstr(
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
FALSE,
|
FALSE,
|
||||||
#endif
|
#endif
|
||||||
openfile->current, openfile->current_x, last_search, NULL);
|
openfile->current, openfile->current_x, last_search, NULL);
|
||||||
|
|
||||||
/* 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 (didfind && fileptr == openfile->current &&
|
if (didfind && fileptr == openfile->current &&
|
||||||
fileptr_x == 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);
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user