Commit 3ba29535 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

do_cut_text() - If the next line is empty when using -k, create a dummy line...

do_cut_text() - If the next line is empty when using -k, create a dummy line and add it to the cutbuffer (fixes bug #61)


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@680 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 0241d19e
Showing with 15 additions and 0 deletions
+15 -0
...@@ -114,6 +114,9 @@ ...@@ -114,6 +114,9 @@
properly (discovered by David Lawrence Ramsey) (59) [FIXED]. properly (discovered by David Lawrence Ramsey) (59) [FIXED].
- On BSD systems, marked cutting sna paste often screws up the - On BSD systems, marked cutting sna paste often screws up the
last line in the cutbuffer (discovered by Barry Pederson) (60) [FIXED] last line in the cutbuffer (discovered by Barry Pederson) (60) [FIXED]
- Blank lines are not kept when cutting with -k (discovered by Rocco)
(61) [FIXED].
** Open BUGS ** ** Open BUGS **
......
...@@ -50,6 +50,9 @@ Cvs code - ...@@ -50,6 +50,9 @@ Cvs code -
- Added 'destructive' argument. Allows the selected text to be - Added 'destructive' argument. Allows the selected text to be
added to the cutbuffer without changing the contents of the added to the cutbuffer without changing the contents of the
file. This allows writing selection to separate files. file. This allows writing selection to separate files.
do_cut_text()
- If the next line is empty when using -k, create a dummy line
and add it to the cutbuffer (fixes bug #61)
- faq.html: - faq.html:
- Brought the FAQ up to date, many little changes (Jordi). - Brought the FAQ up to date, many little changes (Jordi).
- files.c: - files.c:
......
...@@ -184,6 +184,15 @@ int do_cut_text(void) ...@@ -184,6 +184,15 @@ int do_cut_text(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) { if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
if (current_x == strlen(current->data)) { if (current_x == strlen(current->data)) {
/* If the next line is empty, create a dummy line and add it
to the cutbuffer */
if (current->next != NULL && strlen(current->next->data) == 0) {
filestruct *junk;
junk = copy_node(current->next);
add_to_cutbuffer(junk);
}
do_delete(); do_delete();
SET(KEEP_CUTBUFFER); SET(KEEP_CUTBUFFER);
marked_cut = 2; marked_cut = 2;
......
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