[PATCH 1/2] menus: remove the ^T toggle between the Where-Is and Go-To-Line menus
Benno Schulenberg <[email protected]> Thu, 7 May 2026 10:49:07 +0200
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
The `flipgoto` toggle (^T) made for an uneven number of help items in
the Where-Is and Go-To-Line menus, and an odd item doesn't look good.
Also, removing the ^T toggle from the Where-Is menu makes its number
of help items equal to that of the Replace menu, which looks nice
when toggling between the two with ^R. And reducing the number of
help items gives the remaining ones more space, which will allow to
unabbreviate three of them in the next commit, which will look better.
Furthermore, this gets rid of the strange and unclear "Go To Text" tag
in the Go-To-Line menu.
Users who insist on having the ^T toggle can help themselves:
bind ^T "{cancel}{gotoline}" search
bind ^T "{cancel}{whereis}" gotoline
The only difference with the old behavior is that these bindings
don't preserve what was typed at the prompt before ^T was hit.
---
src/global.c | 12 ------------
src/prototypes.h | 1 -
src/rcfile.c | 2 --
src/search.c | 10 ----------
4 files changed, 25 deletions(-)
diff --git a/src/global.c b/src/global.c
index a74f0bfb..bc62ee49 100644
--- a/src/global.c
+++ b/src/global.c
@@ -313,7 +313,6 @@ void get_older_item(void) {;}
void get_newer_item(void) {;}
#endif
void flip_replace(void) {;}
-void flip_goto(void) {;}
#ifdef ENABLE_BROWSER
void to_files(void) {;}
void goto_dir(void) {;}
@@ -780,8 +779,6 @@ void shortcut_init(void)
#ifndef NANO_TINY
add_to_funcs(full_refresh, MINSERTFILE|MEXECUTE, "Refresh", "x", 0);
#endif
- add_to_funcs(flip_goto, MWHEREIS, "Go To Line", "x", 0);
- add_to_funcs(flip_goto, MGOTOLINE, "Go To Text", "x", 0);
#endif
add_to_funcs(do_writeout, MMAIN,
@@ -1151,13 +1148,6 @@ void shortcut_init(void)
N_("Formatter"), WHENHELP(formatter_gist), BLANKAFTER);
#endif
-#ifdef ENABLE_HELP
- add_to_funcs(flip_goto, MWHEREIS,
- N_("Go To Line"), WHENHELP(gotoline_gist), BLANKAFTER);
- add_to_funcs(flip_goto, MGOTOLINE,
- N_("Go To Text"), WHENHELP(whereis_gist), BLANKAFTER);
-#endif
-
#ifndef NANO_TINY
add_to_funcs(dos_format, MWRITEFILE,
N_("DOS Format"), WHENHELP(dos_gist), TOGETHER);
@@ -1506,8 +1496,6 @@ void shortcut_init(void)
add_to_sclist(MWHEREIS|MREPLACE, "M-R", 0, regexp_void, 0);
add_to_sclist(MWHEREIS|MREPLACE, "M-B", 0, backwards_void, 0);
add_to_sclist(MWHEREIS|MREPLACE, "^R", 0, flip_replace, 0);
- add_to_sclist(MWHEREIS|MGOTOLINE, "^T", 0, flip_goto, 0);
- add_to_sclist(MWHEREIS|MGOTOLINE, SLASH_OR_DASH, 0, flip_goto, 0);
#ifdef ENABLE_HISTORIES
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^P", 0, get_older_item, 0);
add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MWHEREISFILE|MFINDINHELP|MEXECUTE, "^N", 0, get_newer_item, 0);
diff --git a/src/prototypes.h b/src/prototypes.h
index f84d1fa2..cadb6d2f 100644
--- a/src/prototypes.h
+++ b/src/prototypes.h
@@ -671,7 +671,6 @@ void get_older_item(void);
void get_newer_item(void);
#endif
void flip_replace(void);
-void flip_goto(void);
#ifdef ENABLE_BROWSER
void to_files(void);
void goto_dir(void);
diff --git a/src/rcfile.c b/src/rcfile.c
index 75e4954a..34cfb1c2 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -409,8 +409,6 @@ keystruct *strtosc(const char *input)
s->func = backwards_void;
else if (!strcmp(input, "flipreplace"))
s->func = flip_replace;
- else if (!strcmp(input, "flipgoto"))
- s->func = flip_goto;
#ifdef ENABLE_HISTORIES
else if (!strcmp(input, "older"))
s->func = get_older_item;
diff --git a/src/search.c b/src/search.c
index 6f82c959..975d36ce 100644
--- a/src/search.c
+++ b/src/search.c
@@ -154,9 +154,6 @@ void search_init(bool replacing, bool retain_answer)
napms(600);
} else
replacing = !replacing;
- } else if (function == flip_goto) {
- ask_for_line_and_column(answer);
- break;
} else
break;
}
@@ -786,13 +783,6 @@ void ask_for_line_and_column(char *provided)
_("Enter line number, column number"));
int doublesign = 0;
- if (func_from_key(response) == flip_goto) {
- UNSET(BACKWARDS_SEARCH);
- /* Switch to searching but retain what the user typed so far. */
- search_init(FALSE, TRUE);
- return;
- }
-
/* When cancelled or blank, or when a function was run, we're done. */
if (response < 0) {
statusbar(_("Cancelled"));
--
2.54.0