Commit d1322107 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

do another int -> bool conversion, and simplify the search/replace

"Cancelled" messages


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1914 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 10 additions and 9 deletions
+10 -9
...@@ -10,6 +10,7 @@ CVS code - ...@@ -10,6 +10,7 @@ CVS code -
shortcut isn't clicked. New functions get_shortcut(), shortcut isn't clicked. New functions get_shortcut(),
get_toggle(), get_edit_input(), and get_edit_mouse(); changes get_toggle(), get_edit_input(), and get_edit_mouse(); changes
to do_browser(), do_justify(), do_help(), and main(). (DLR) to do_browser(), do_justify(), do_help(), and main(). (DLR)
- Simplify a few more translated messages. (DLR)
- global.c: - global.c:
shortcut_init() shortcut_init()
- Remove redundant NANO_SMALL #ifdef. (DLR) - Remove redundant NANO_SMALL #ifdef. (DLR)
......
...@@ -391,7 +391,7 @@ void regexp_cleanup(void); ...@@ -391,7 +391,7 @@ void regexp_cleanup(void);
void not_found_msg(const char *str); void not_found_msg(const char *str);
void search_abort(void); void search_abort(void);
void search_init_globals(void); void search_init_globals(void);
int search_init(int replacing); int search_init(bool replacing);
int is_whole_word(int curr_pos, const char *datastr, const char int is_whole_word(int curr_pos, const char *datastr, const char
*searchword); *searchword);
int findnextstr(int can_display_wrap, int wholeword, const filestruct int findnextstr(int can_display_wrap, int wholeword, const filestruct
......
...@@ -110,14 +110,14 @@ void search_init_globals(void) ...@@ -110,14 +110,14 @@ void search_init_globals(void)
} }
/* Set up the system variables for a search or replace. Return -1 if /* Set up the system variables for a search or replace. Return -1 if
* the search should be cancelled (due to Cancel, Go to Line, or a * the search should be canceled (due to Cancel, Go to Line, or a failed
* failed regcomp()). Return 0 on success, and 1 on rerun calling * regcomp()). Return 0 on success, and 1 on rerun calling program.
* program. Return -2 to run opposite program (search -> replace, * Return -2 to run opposite program (search -> replace, replace ->
* replace -> search). * search).
* *
* replacing = 1 if we call from do_replace(), 0 if called from * replacing is TRUE if we call from do_replace(), FALSE if called from
* do_search(). */ * do_search(). */
int search_init(int replacing) int search_init(bool replacing)
{ {
int i = 0; int i = 0;
char *buf; char *buf;
...@@ -194,7 +194,7 @@ int search_init(int replacing) ...@@ -194,7 +194,7 @@ int search_init(int replacing)
/* Cancel any search, or just return with no previous search. */ /* Cancel any search, or just return with no previous search. */
if (i == -1 || (i < 0 && last_search[0] == '\0') || if (i == -1 || (i < 0 && last_search[0] == '\0') ||
(!replacing && i == 0 && answer[0] == '\0')) { (!replacing && i == 0 && answer[0] == '\0')) {
statusbar(_("Search Cancelled")); statusbar(_("Cancelled"));
#ifndef NANO_SMALL #ifndef NANO_SMALL
search_history.current = search_history.next; search_history.current = search_history.next;
#endif #endif
...@@ -805,7 +805,7 @@ void do_replace(void) ...@@ -805,7 +805,7 @@ void do_replace(void)
if (i == -1) { /* Cancel. */ if (i == -1) { /* Cancel. */
if (last_replace[0] != '\0') if (last_replace[0] != '\0')
answer = mallocstrcpy(answer, last_replace); answer = mallocstrcpy(answer, last_replace);
statusbar(_("Replace Cancelled")); statusbar(_("Cancelled"));
} }
replace_abort(); replace_abort();
return; return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment