No more cutting the macic line, added check_statblank() to cut and uncut

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@174 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-08-07 14:39:32 +00:00
parent 9b45ff54ac
commit c86f714a15
3 changed files with 14 additions and 17 deletions

View File

@ -2,6 +2,11 @@ CVS code
- cut.c: - cut.c:
do_cut_text() do_cut_text()
- Fixed getting locked into cutbuffer on cutting first line of file. - Fixed getting locked into cutbuffer on cutting first line of file.
- Added check_statblank().
- Check for fileptr == filebot, if so return, we shouldn't bother
cutting the magic line.
do_uncut_text()
- Added check_statblank().
- nano.c: - nano.c:
main() main()
- Changed tabsize long arg to actually accept an argument *sigh*. - Changed tabsize long arg to actually accept an argument *sigh*.

18
cut.c
View File

@ -136,7 +136,8 @@ int do_cut_text(void)
int newsize, cuttingtoend = 0; int newsize, cuttingtoend = 0;
#endif #endif
if (fileptr == NULL || fileptr->data == NULL) check_statblank();
if (fileptr == NULL || fileptr->data == NULL || fileptr == filebot)
return 0; return 0;
tmp = fileptr->next; tmp = fileptr->next;
@ -242,18 +243,8 @@ int do_cut_text(void)
current = fileptr->next; current = fileptr->next;
totlines--; totlines--;
totsize--; /* get the newline */ totsize--; /* get the newline */
} else { } /* No longer an else here, because we never get here anymore...
/* we're deleteing the last line No need to cut the magic line, as it's empty */
and replacing it with a dummy line,
so totlines is the same */
tmp = fileptr->prev;
tmp->next = make_new_node(tmp);
tmp = tmp->next;
tmp->data = nmalloc(1);
strcpy(tmp->data, "");
current = tmp;
filebot = tmp;
}
add_to_cutbuffer(fileptr); add_to_cutbuffer(fileptr);
} }
@ -285,6 +276,7 @@ int do_uncut_text(void)
int i; int i;
wrap_reset(); wrap_reset();
check_statblank();
if (cutbuffer == NULL || fileptr == NULL) if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */ return 0; /* AIEEEEEEEEEEEE */

View File

@ -1,12 +1,12 @@
# Nano strings file. # SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc. # Copyright (C) YEAR Free Software Foundation, Inc.
# Chris Allegretta <chrisa@asty.org>, 2000. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-08-06 17:19-0400\n" "POT-Creation-Date: 2000-08-07 10:44-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -19,7 +19,7 @@ msgstr ""
msgid "add_to_cutbuffer called with inptr->data = %s\n" msgid "add_to_cutbuffer called with inptr->data = %s\n"
msgstr "" msgstr ""
#: cut.c:149 #: cut.c:150
msgid "Blew away cutbuffer =)\n" msgid "Blew away cutbuffer =)\n"
msgstr "" msgstr ""