do_statusbar_right(), do_statusbar_left(),
do_statusbar_backspace(), and do_statusbar_delete(). (David
Benbennick and DLR)
+ - Implement cutting from the current position to the end of the
+ file, using Ctrl-X from the search prompt and Meta-T from the
+ edit window. New function do_cut_till_end(). Note that this
+ is disabled when NANO_SMALL is defined. (DLR, based on ideas
+ from a patch for Pico by Eduardo Chappa, suggested by Ryan
+ Dlugosz and Paul Adams)
- cut.c:
do_cut_text()
- If keep_cutbuffer is FALSE, only blow away the text in the
/**************************************************************************
* cut.c *
* *
- * Copyright (C) 1999-2004 Chris Allegretta *
+ * Copyright (C) 1999-2005 Chris Allegretta *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
#endif
}
+#ifndef NANO_SMALL
+/* Cut from the current cursor position to the end of the file. */
+void do_cut_till_end(void)
+{
+ assert(current != NULL && current->data != NULL);
+
+ check_statusblank();
+
+ move_to_filestruct(&cutbuffer, &cutbottom, current, current_x,
+ filebot, 0);
+
+ edit_refresh();
+ set_modified();
+
+#ifdef DEBUG
+ dump_buffer(cutbuffer);
+#endif
+}
+#endif
+
/* Copy text from the cutbuffer into the current filestruct. */
void do_uncut_text(void)
{
const char *cancel_msg = N_("Cancel");
const char *first_line_msg = N_("First Line");
const char *last_line_msg = N_("Last Line");
+#ifndef NANO_SMALL
+ const char *cut_till_end_msg = N_("CutTillEnd");
+#endif
#ifndef DISABLE_JUSTIFY
const char *beg_of_par_msg = N_("Beg of Par");
const char *end_of_par_msg = N_("End of Par");
const char *nano_opennext_msg = N_("Switch to the next file buffer");
#endif
const char *nano_verbatim_msg = N_("Insert character(s) verbatim");
+#ifndef NANO_SMALL
+ const char *nano_cut_till_end_msg =
+ N_("Cut from the cursor position to the end of the file");
+#endif
#ifndef DISABLE_JUSTIFY
const char *nano_fulljustify_msg = N_("Justify the entire file");
#endif
IFHELP(nano_verbatim_msg, NANO_VERBATIM_KEY), NANO_NO_KEY,
NANO_NO_KEY, NOVIEW, do_verbatim_input);
+#ifndef NANO_SMALL
+ /* Translators: try to keep this string under 10 characters long */
+ sc_init_one(&main_list, NANO_NO_KEY, cut_till_end_msg,
+ IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
+ NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
+#endif
+
#ifndef DISABLE_JUSTIFY
/* Translators: try to keep this string under 10 characters long */
sc_init_one(&main_list, NANO_NO_KEY, fulljstify_msg,
sc_init_one(&whereis_list, NANO_HISTORY_KEY, history_msg,
IFHELP(nano_editstr_msg, NANO_NO_KEY), NANO_NO_KEY,
NANO_NO_KEY, VIEW, 0);
+
+ /* Translators: try to keep this string under 10 characters long */
+ sc_init_one(&whereis_list, NANO_CUTTILLEND_KEY, cut_till_end_msg,
+ IFHELP(nano_cut_till_end_msg, NANO_CUTTILLEND_ALTKEY),
+ NANO_NO_KEY, NANO_NO_KEY, NOVIEW, do_cut_till_end);
#endif /* !NANO_SMALL */
#ifndef DISABLE_JUSTIFY
/**************************************************************************
* nano.h *
* *
- * Copyright (C) 1999-2004 Chris Allegretta *
+ * Copyright (C) 1999-2005 Chris Allegretta *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2, or (at your option) *
#define NANO_BRACKET_KEY NANO_ALT_RBRACKET
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
+#define NANO_CUTTILLEND_KEY NANO_CONTROL_X
+#define NANO_CUTTILLEND_ALTKEY NANO_ALT_T
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
#define NANO_PARABEGIN_ALTKEY1 NANO_ALT_LPAREN
#define NANO_PARABEGIN_ALTKEY2 NANO_ALT_9
#endif
void cut_to_eol(void);
void do_cut_text(void);
+#ifndef NANO_SMALL
+void do_cut_till_end(void);
+#endif
void do_uncut_text(void);
/* Public functions in files.c. */