diff --git a/ChangeLog b/ChangeLog index 0576beaabf2ef205ca4f92caeaff8b9795e8a044..b8222ce4564fb33bb7baa37387a57ea741e88d85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2014-06-23 Benno Schulenberg <bensberg@justemail.net> * src/nano.h, src/move.c (do_up, do_down), src/winio.c (edit_scrol): Rename UP_DIR and DOWN_DIR to UPWARD and DOWNWARD, for clarity. + * src/proto.h, src/global.c, src/search.c: Rename 'no_replace_void()' + to 'flip_replace_void()', to show what it actually does. + * doc/man/nanorc.5, doc/texinfo/nano.texi: Update the docs for that. 2014-06-22 Benno Schulenberg <bensberg@justemail.net> * src/browser.c (parse_browser_input), src/help.c (parse_help_input): diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5 index ffc36398286d74d1a0e725cadf51f44afdf6008b..5ba4f7318da7b310ef93f84976ad26a2e4ab8154 100644 --- a/doc/man/nanorc.5 +++ b/doc/man/nanorc.5 @@ -514,8 +514,8 @@ Shows the previous history entry in the prompt menus (e.g. search). .B nexthistory Shows the next history entry in the prompt menus (e.g. search). .TP -.B dontreplace -Switches back to searching instead of replacing. +.B flipreplace +Toggles between searching for something and replacing something. .TP .B flipexecute Toggles between inserting a file and executing a command. diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi index 40fc42fc7880a61d0704e38ec4507449bed89282..0ee187464c70b73c09d546f85b1a5eaee0463228 100644 --- a/doc/texinfo/nano.texi +++ b/doc/texinfo/nano.texi @@ -1040,8 +1040,8 @@ Shows the previous history entry in the prompt menus (e.g. search). @item nexthistory Shows the next history entry in the prompt menus (e.g. search). -@item dontreplace -Switches back to searching instead of replacing. +@item flipreplace +Toggles between searching for something and replacing something. @item flipexecute Toggles between inserting a file and executing a command. diff --git a/src/global.c b/src/global.c index 86151f9e1822500f1a38f19320468c8534b51e3b..36a2c63fb6b95273e355cbbaac27c32f968986bc 100644 --- a/src/global.c +++ b/src/global.c @@ -267,7 +267,7 @@ void backup_file_void(void) void new_buffer_void(void) { } -void no_replace_void(void) +void flip_replace_void(void) { } void flip_execute_void(void) @@ -741,10 +741,10 @@ void shortcut_init(void) N_("Backwards"), IFSCHELP(nano_reverse_msg), FALSE, VIEW); #endif - add_to_funcs(do_replace, MWHEREIS, + add_to_funcs(flip_replace_void, MWHEREIS, replace_tag, IFSCHELP(nano_replace_msg), FALSE, VIEW); - add_to_funcs(no_replace_void, MREPLACE, + add_to_funcs(flip_replace_void, MREPLACE, N_("No Replace"), IFSCHELP(nano_whereis_msg), FALSE, VIEW); #ifndef DISABLE_JUSTIFY @@ -1115,8 +1115,7 @@ void shortcut_init(void) add_to_sclist(MWHEREIS|MREPLACE, "M-C", case_sens_void, 0, FALSE); #endif add_to_sclist(MWHEREIS|MREPLACE, "M-R", regexp_void, 0, FALSE); - add_to_sclist(MWHEREIS, "^R", do_replace, 0, FALSE); - add_to_sclist(MREPLACE, "^R", no_replace_void, 0, FALSE); + add_to_sclist(MWHEREIS|MREPLACE, "^R", flip_replace_void, 0, FALSE); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^Y", do_first_line, 0, TRUE); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^V", do_last_line, 0, TRUE); #ifndef DISABLE_JUSTIFY @@ -1474,8 +1473,9 @@ sc *strtosc(char *input) s->scfunc = backwards_void; s->execute = FALSE; #endif - } else if (!strcasecmp(input, "dontreplace")) { - s->scfunc = no_replace_void; + } else if (!strcasecmp(input, "flipreplace") || + !strcasecmp(input, "dontreplace")) { + s->scfunc = flip_replace_void; s->execute = FALSE; } else if (!strcasecmp(input, "gototext")) { s->scfunc = gototext_void; diff --git a/src/proto.h b/src/proto.h index 44a4dd000a58c520d531773c58660d7b5dd14a0a..1226188fe359a0db907c2af4c03911a7d0d0a48e 100644 --- a/src/proto.h +++ b/src/proto.h @@ -831,7 +831,7 @@ void backup_file_void(void); void new_buffer_void(void); void backwards_void(void); void goto_dir_void(void); -void no_replace_void(void); +void flip_replace_void(void); void flip_execute_void(void); #endif /* !PROTO_H */ diff --git a/src/search.c b/src/search.c index 690be6d9f380cf0c219733d355e027b2247f0638..06d0208eb4fe8d8e0c232f08be28b639184f8c65 100644 --- a/src/search.c +++ b/src/search.c @@ -249,7 +249,7 @@ int search_init(bool replacing, bool use_answer) backupstring = mallocstrcpy(backupstring, answer); return 1; #endif - } else if (func == do_replace || func == no_replace_void) { + } else if (func == do_replace || func == flip_replace_void) { backupstring = mallocstrcpy(backupstring, answer); return -2; /* Call the opposite search function. */ } else if (func == do_gotolinecolumn_void) {