Commit a75bc41f authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Better for for -k bug

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@683 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 1cde3223
Showing with 6 additions and 10 deletions
+6 -10
...@@ -51,8 +51,8 @@ Cvs code - ...@@ -51,8 +51,8 @@ Cvs code -
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() do_cut_text()
- If the next line is empty when using -k, create a dummy line - If the line is empty when using -k and wasn't already added,
and add it to the cutbuffer (fixes bug #61) 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:
......
...@@ -185,16 +185,12 @@ int do_cut_text(void) ...@@ -185,16 +185,12 @@ int do_cut_text(void)
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 /* If the line is empty and we didn't just cut a non-blank
to the cutbuffer */ line, create a dummy line and add it to the cutbuffer */
if ((current->next != NULL && strlen(current->next->data) == 0) || if (current_x == 0 && marked_cut != 1) {
(current == fileage && strlen(current->data) == 0)) {
filestruct *junk; filestruct *junk;
if (current == fileage) junk = copy_node(current);
junk = copy_node(current);
else
junk = copy_node(current->next);
add_to_cutbuffer(junk); add_to_cutbuffer(junk);
} }
......
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