diff -u nano/files.c nano-strange/files.c --- nano/files.c Sun May 5 19:15:56 2002 +++ nano-strange/files.c Sun May 5 22:26:11 2002 @@ -258,7 +258,6 @@ } else if (fileptr->next == NULL) { filebot = fileptr; new_magicline(); - totsize--; /* Update the edit buffer */ load_file(quiet); @@ -447,6 +446,13 @@ UNSET(MODIFIED); } #endif + + /* Here is a kludge. If the current file is blank (including + * after new_file()), then totlines==1 and totsize==0. Thus + * after open_pipe() or open_file() below, the totsize is short + * by one. */ + if (totlines==1 && totsize==0) + totsize++; #ifndef NANO_SMALL if (i == NANO_EXTCMD_KEY) { diff -u nano/nano.c nano-strange/nano.c --- nano/nano.c Sun May 5 19:15:56 2002 +++ nano-strange/nano.c Sun May 5 21:39:58 2002 @@ -1292,8 +1292,6 @@ int do_delete(void) { - filestruct *foo; - /* blbf -> blank line before filebot (see below) */ int blbf = 0; @@ -1307,11 +1305,12 @@ align(¤t->data); - /* Now that we have a magic line again, we can check for both being - on the line before filebot as well as at filebot; it's a special - case if we're on the line before filebot and it's blank, since we - should be able to delete it */ } else if (current->next != NULL && (current->next != filebot || blbf)) { + /* We can delete the line before filebot only if it is blank: it + * becomes the new magic line then. */ + + filestruct *foo; + current->data = nrealloc(current->data, strlen(current->data) + strlen(current->next->data) + 1); @@ -1326,14 +1325,6 @@ unlink_node(foo); delete_node(foo); update_line(current, current_x); - - /* Please see the comment in do_backspace if you don't understand - this test */ - if (current == filebot && strcmp(current->data, "")) { - new_magicline(); - fix_editbot(); - totsize++; - } renumber(current); totlines--; } else