Commit b80d49f0 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

make sure that all references to cut-to-end are left out when NANO_SMALL

is defined


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2435 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 14 additions and 9 deletions
+14 -9
...@@ -4,6 +4,9 @@ CVS code - ...@@ -4,6 +4,9 @@ CVS code -
- After (re)initializing the terminal, make sure the cursor is - After (re)initializing the terminal, make sure the cursor is
always turned on. Changes to do_alt_speller(), always turned on. Changes to do_alt_speller(),
handle_sigwinch(), and main(). (DLR) handle_sigwinch(), and main(). (DLR)
- Make sure that all references to cut-to-end are left out when
NANO_SMALL is defined. Changes to cut_to_eol(),
do_cut_text(), and do_statusbar_cut_text(). (DLR)
- chars.c: - chars.c:
make_mbchar() make_mbchar()
- Remove unneeded assert. (DLR) - Remove unneeded assert. (DLR)
...@@ -40,8 +43,7 @@ CVS code - ...@@ -40,8 +43,7 @@ CVS code -
HAVE_GETOPT_LONG isn't defined. (DLR) HAVE_GETOPT_LONG isn't defined. (DLR)
usage() usage()
- Fix erroneous #ifdef that resulted in the -d/--rebinddelete - Fix erroneous #ifdef that resulted in the -d/--rebinddelete
and -k/--cut options' not being printed when NANO_SMALL was option's not being printed when NANO_SMALL was defined. (DLR)
defined. (DLR)
find_paragraph() find_paragraph()
- Fix problem where a search for the next paragraph would skip - Fix problem where a search for the next paragraph would skip
over certain cases of one-line paragraphs. (DLR) over certain cases of one-line paragraphs. (DLR)
......
...@@ -63,7 +63,6 @@ void cut_marked(void) ...@@ -63,7 +63,6 @@ void cut_marked(void)
move_to_filestruct(&cutbuffer, &cutbottom, top, top_x, bot, bot_x); move_to_filestruct(&cutbuffer, &cutbottom, top, top_x, bot, bot_x);
placewewant = xplustabs(); placewewant = xplustabs();
} }
#endif
/* If we're not at the end of the current line, move all the text from /* If we're not at the end of the current line, move all the text from
* the current cursor position to the end of the current line, * the current cursor position to the end of the current line,
...@@ -93,6 +92,7 @@ void cut_to_eol(void) ...@@ -93,6 +92,7 @@ void cut_to_eol(void)
placewewant = xplustabs(); placewewant = xplustabs();
} }
} }
#endif /* !NANO_SMALL */
/* Move text from the current filestruct into the cutbuffer. */ /* Move text from the current filestruct into the cutbuffer. */
void do_cut_text(void) void do_cut_text(void)
...@@ -122,13 +122,12 @@ void do_cut_text(void) ...@@ -122,13 +122,12 @@ void do_cut_text(void)
* turn the mark off. */ * turn the mark off. */
cut_marked(); cut_marked();
UNSET(MARK_ISSET); UNSET(MARK_ISSET);
} else } else if (ISSET(CUT_TO_END))
#endif
if (ISSET(CUT_TO_END))
/* Otherwise, if the CUT_TO_END flag is set, move all text up to /* Otherwise, if the CUT_TO_END flag is set, move all text up to
* the end of the line into the cutbuffer. */ * the end of the line into the cutbuffer. */
cut_to_eol(); cut_to_eol();
else else
#endif
/* Otherwise, move the entire line into the cutbuffer. */ /* Otherwise, move the entire line into the cutbuffer. */
cut_line(); cut_line();
...@@ -158,7 +157,7 @@ void do_cut_till_end(void) ...@@ -158,7 +157,7 @@ void do_cut_till_end(void)
dump_buffer(cutbuffer); dump_buffer(cutbuffer);
#endif #endif
} }
#endif #endif /* !NANO_SMALL */
/* Copy text from the cutbuffer into the current filestruct. */ /* Copy text from the cutbuffer into the current filestruct. */
void do_uncut_text(void) void do_uncut_text(void)
......
...@@ -1005,8 +1005,8 @@ void usage(void) ...@@ -1005,8 +1005,8 @@ void usage(void)
print1opt("-d", "--rebinddelete", N_("Fix Backspace/Delete confusion problem")); print1opt("-d", "--rebinddelete", N_("Fix Backspace/Delete confusion problem"));
#ifndef NANO_SMALL #ifndef NANO_SMALL
print1opt("-i", "--autoindent", N_("Automatically indent new lines")); print1opt("-i", "--autoindent", N_("Automatically indent new lines"));
#endif
print1opt("-k", "--cut", N_("Cut from cursor to end of line")); print1opt("-k", "--cut", N_("Cut from cursor to end of line"));
#endif
print1opt("-l", "--nofollow", N_("Don't follow symbolic links, overwrite")); print1opt("-l", "--nofollow", N_("Don't follow symbolic links, overwrite"));
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
print1opt("-m", "--mouse", N_("Enable mouse")); print1opt("-m", "--mouse", N_("Enable mouse"));
......
...@@ -223,8 +223,8 @@ void cutbuffer_reset(void); ...@@ -223,8 +223,8 @@ void cutbuffer_reset(void);
void cut_line(void); void cut_line(void);
#ifndef NANO_SMALL #ifndef NANO_SMALL
void cut_marked(void); void cut_marked(void);
#endif
void cut_to_eol(void); void cut_to_eol(void);
#endif
void do_cut_text(void); void do_cut_text(void);
#ifndef NANO_SMALL #ifndef NANO_SMALL
void do_cut_till_end(void); void do_cut_till_end(void);
......
...@@ -1887,12 +1887,16 @@ void do_statusbar_cut_text(void) ...@@ -1887,12 +1887,16 @@ void do_statusbar_cut_text(void)
{ {
assert(answer != NULL); assert(answer != NULL);
#ifndef NANO_SMALL
if (ISSET(CUT_TO_END)) if (ISSET(CUT_TO_END))
null_at(&answer, statusbar_x); null_at(&answer, statusbar_x);
else { else {
#endif
null_at(&answer, 0); null_at(&answer, 0);
statusbar_x = 0; statusbar_x = 0;
#ifndef NANO_SMALL
} }
#endif
} }
#ifndef NANO_SMALL #ifndef NANO_SMALL
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment