diff --git a/doc/nano.texi b/doc/nano.texi index 66c63aa4..7becdab9 100644 --- a/doc/nano.texi +++ b/doc/nano.texi @@ -1225,9 +1225,6 @@ Goes to the last line of the file. Goes to a specific line (and column if specified). Negative numbers count from the end of the file (and end of the line). -@item gototext -Switches from targeting a line number to searching for text. - @item findbracket Moves the cursor to the bracket (brace, parenthesis, etc.) that matches (pairs) with the one under the cursor. @@ -1293,6 +1290,10 @@ Shows the next history entry in the prompt menus (e.g.@: search). Toggles between searching for something and replacing something. (The form @code{dontreplace} is deprecated.) +@item flipgoto +Toggles between searching for text and targeting a line number. +(The form @code{gototext} is deprecated.) + @item flipexecute Toggles between inserting a file and executing a command. diff --git a/doc/nanorc.5 b/doc/nanorc.5 index 578630a3..b33468eb 100644 --- a/doc/nanorc.5 +++ b/doc/nanorc.5 @@ -579,9 +579,6 @@ Goes to the last line of the file. Goes to a specific line (and column if specified). Negative numbers count from the end of the file (and end of the line). .TP -.B gototext -Switches from targeting a line number to searching for text. -.TP .B findbracket Moves the cursor to the bracket (brace, parenthesis, etc.) that matches (pairs) with the one under the cursor. @@ -647,6 +644,10 @@ Shows the next history entry in the prompt menus (e.g. search). Toggles between searching for something and replacing something. (The form 'dontreplace' is deprecated.) .TP +.B flipgoto +Toggles between searching for text and targeting a line number. +(The form 'gototext' is deprecated.) +.TP .B flipexecute Toggles between inserting a file and executing a command. .TP diff --git a/src/global.c b/src/global.c index fadd6fdc..20eeb62c 100644 --- a/src/global.c +++ b/src/global.c @@ -279,7 +279,7 @@ void backwards_void(void) void flip_replace(void) { } -void gototext_void(void) +void flip_goto(void) { } #ifdef ENABLE_BROWSER @@ -822,7 +822,7 @@ void shortcut_init(void) add_to_funcs(do_full_justify, MWHEREIS, fulljustify_tag, WITHORSANS(fulljustify_gist), TOGETHER, NOVIEW); - add_to_funcs(do_gotolinecolumn_void, MWHEREIS, + add_to_funcs(flip_goto, MWHEREIS, gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW); #endif @@ -991,11 +991,11 @@ void shortcut_init(void) #endif #ifndef ENABLE_JUSTIFY - add_to_funcs(do_gotolinecolumn_void, MWHEREIS, + add_to_funcs(flip_goto, MWHEREIS, gotoline_tag, WITHORSANS(gotoline_gist), BLANKAFTER, VIEW); #endif - add_to_funcs(gototext_void, MGOTOLINE, + add_to_funcs(flip_goto, MGOTOLINE, N_("Go To Text"), WITHORSANS(whereis_gist), BLANKAFTER, VIEW); #ifndef NANO_TINY @@ -1281,8 +1281,7 @@ void shortcut_init(void) add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^W", 0, do_para_begin_void, 0); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH, "^O", 0, do_para_end_void, 0); #endif - add_to_sclist(MWHEREIS, "^T", 0, do_gotolinecolumn_void, 0); - add_to_sclist(MGOTOLINE, "^T", 0, gototext_void, 0); + add_to_sclist(MWHEREIS|MGOTOLINE, "^T", 0, flip_goto, 0); #ifdef ENABLE_HISTORIES add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "^P", 0, get_history_older_void, 0); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXTCMD, "^N", 0, get_history_newer_void, 0); @@ -1617,8 +1616,9 @@ sc *strtosc(const char *input) else if (!strcasecmp(input, "flipreplace") || !strcasecmp(input, "dontreplace")) /* Deprecated. Remove in 2018. */ s->scfunc = flip_replace; - else if (!strcasecmp(input, "gototext")) - s->scfunc = gototext_void; + else if (!strcasecmp(input, "flipgoto") || + !strcasecmp(input, "gototext")) /* Deprecated. Remove end of 2018. */ + s->scfunc = flip_goto; #ifdef ENABLE_HISTORIES else if (!strcasecmp(input, "prevhistory")) s->scfunc = get_history_older_void; diff --git a/src/proto.h b/src/proto.h index a7d90689..c4f6f074 100644 --- a/src/proto.h +++ b/src/proto.h @@ -692,7 +692,7 @@ void case_sens_void(void); void regexp_void(void); void backwards_void(void); void flip_replace(void); -void gototext_void(void); +void flip_goto(void); #ifdef ENABLE_BROWSER void to_files_void(void); void goto_dir_void(void); diff --git a/src/search.c b/src/search.c index 663f3278..214dc158 100644 --- a/src/search.c +++ b/src/search.c @@ -189,7 +189,7 @@ int search_init(bool replacing, bool use_answer) } else if (func == flip_replace) { backupstring = mallocstrcpy(backupstring, answer); return -2; /* Call the opposite search function. */ - } else if (func == do_gotolinecolumn_void) { + } else if (func == flip_goto) { do_gotolinecolumn(openfile->current->lineno, openfile->placewewant + 1, TRUE, TRUE); return 3; @@ -810,7 +810,7 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer, return; } - if (func_from_key(&i) == gototext_void) { + if (func_from_key(&i) == flip_goto) { /* Retain what the user typed so far and switch to searching. */ search_init(TRUE, TRUE); do_search();