notably FreeBSD; if your Backspace key acts like Delete, this
option will fix that. (DLR)
- Remove unneeded breaks at the ends of default: clauses. (DLR)
+ - Add the ability to repeat the last search without prompting
+ via Meta-W, and move the line wrapping toggle to Meta-L. New
+ function do_research(). (Wouter van Hemel)
+ - Change the message for the line wrapping toggle from "Auto
+ wrap" to "Auto line wrap", to more clearly associate it with
+ Meta-L. (DLR)
- files.c:
do_browser():
- Some of the Pico compatibility options in the file browser
toggle_syntax_msg = _("Color syntax highlighting");
#endif
#ifndef DISABLE_WRAPPING
- toggle_wrap_msg = _("Auto wrap");
+ toggle_wrap_msg = _("Auto line wrap");
#endif
#ifdef ENABLE_MULTIBUFFER
toggle_load_msg = _("Multiple file buffers");
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
"", *nano_goto_msg = "", *nano_justify_msg =
"", *nano_replace_msg = "", *nano_insert_msg =
- "", *nano_whereis_msg = "", *nano_prevpage_msg =
- "", *nano_nextpage_msg = "", *nano_cut_msg =
- "", *nano_uncut_msg = "", *nano_cursorpos_msg =
- "", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
+ "", *nano_whereis_msg = "", *nano_whereis_next_msg =
+ "", *nano_prevpage_msg = "", *nano_nextpage_msg =
+ "", *nano_cut_msg = "", *nano_uncut_msg =
+ "", *nano_cursorpos_msg = "", *nano_spell_msg =
+ "", *nano_up_msg = "", *nano_down_msg =
"", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
"", *nano_end_msg = "", *nano_firstline_msg =
"", *nano_lastline_msg = "", *nano_refresh_msg =
nano_replace_msg = _("Replace text within the editor");
nano_insert_msg = _("Insert another file into the current one");
nano_whereis_msg = _("Search for text within the editor");
+ nano_whereis_next_msg = _("Repeat last search");
nano_prevpage_msg = _("Move to the previous screen");
nano_nextpage_msg = _("Move to the next screen");
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY),
0, 0, VIEW, do_find_bracket);
#endif
+
+ sc_init_one(&main_list, -9, _("Where Is Next"),
+ IFHELP(nano_whereis_next_msg, NANO_WHEREIS_NEXT_KEY), 0, 0,
+ NOVIEW, do_research);
+
#ifdef ENABLE_MULTIBUFFER
sc_init_one(&main_list, -9, _("Previous File"),
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY),
#define NANO_HELP_FKEY KEY_F(1)
#define NANO_WHEREIS_KEY NANO_CONTROL_W
#define NANO_WHEREIS_FKEY KEY_F(6)
+#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
#define NANO_REPLACE_KEY NANO_CONTROL_4
#define NANO_REPLACE_FKEY KEY_F(14)
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
#define TOGGLE_MOUSE_KEY NANO_ALT_M
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
#define TOGGLE_REGEXP_KEY NANO_ALT_R
-#define TOGGLE_WRAP_KEY NANO_ALT_W
+#define TOGGLE_WRAP_KEY NANO_ALT_L
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
#define TOGGLE_CASE_KEY NANO_ALT_C
#define TOGGLE_LOAD_KEY NANO_ALT_F
return 1;
}
+/* Search for the next string without prompting. */
+int do_research(void)
+{
+ filestruct *fileptr = current, *didfind;
+ int fileptr_x = current_x;
+#ifdef HAVE_REGEX_H
+ const char *regex_error = _("Invalid regex \"%s\"");
+#endif /* HAVE_REGEX_H */
+
+ wrap_reset();
+ search_init_globals();
+
+ if (last_search[0] != '\0') {
+
+#ifdef HAVE_REGEX_H
+ if (ISSET(USE_REGEXP))
+ if (regexp_init(last_search) == 0) {
+ statusbar(regex_error, last_search);
+ reset_cursor();
+ return -3;
+ }
+#endif
+
+ search_last_line = 0;
+ didfind = findnextstr(FALSE, FALSE, current, current_x, last_search);
+
+ if (fileptr == current && fileptr_x == current_x && didfind != NULL)
+ statusbar(_("This is the only occurrence"));
+ else if (current->lineno <= edittop->lineno
+ || current->lineno >= editbot->lineno)
+ edit_update(current, CENTER);
+
+ } else
+ statusbar(_("No current search pattern"));
+
+ search_abort();
+
+ return 1;
+}
+
void replace_abort(void)
{
/* Identical to search_abort, so we'll call it here. If it