slightly better cut to end behavior, still doesn't preserve cutbuffer w/multi line cuts

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@127 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-07-25 03:20:07 +00:00
parent c9b1dba4a3
commit 45dfda97d8
2 changed files with 46 additions and 28 deletions

22
cut.c
View File

@ -133,7 +133,8 @@ int do_cut_text(void)
filestruct *tmp, *fileptr = current; filestruct *tmp, *fileptr = current;
#ifndef NANO_SMALL #ifndef NANO_SMALL
char *tmpstr; char *tmpstr;
int newsize; int newsize, cuttingtoend = 0;
#endif #endif
if (fileptr == NULL || fileptr->data == NULL) if (fileptr == NULL || fileptr->data == NULL)
@ -150,9 +151,23 @@ 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))
{
/* FIXME - We really need to put this data into the
cutbuffer, not delete it and forget about it. */
do_delete();
return 1;
}
else
{
SET(MARK_ISSET); SET(MARK_ISSET);
mark_beginbuf = current; SET(KEEP_CUTBUFFER);
mark_beginx = strlen(current->data); mark_beginx = strlen(current->data);
mark_beginbuf = current;
cuttingtoend = 1;
}
} }
if (ISSET(MARK_ISSET)) { if (ISSET(MARK_ISSET)) {
if (current->lineno == mark_beginbuf->lineno) { if (current->lineno == mark_beginbuf->lineno) {
@ -190,6 +205,9 @@ int do_cut_text(void)
UNSET(MARK_ISSET); UNSET(MARK_ISSET);
marked_cut = 1; marked_cut = 1;
set_modified(); set_modified();
if (cuttingtoend)
edit_refresh();
else
edit_update(current); edit_update(current);
return 1; return 1;
#else #else

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-07-24 18:10-0400\n" "POT-Creation-Date: 2000-07-24 23:24-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:148 #: cut.c:149
msgid "Blew away cutbuffer =)\n" msgid "Blew away cutbuffer =)\n"
msgstr "" msgstr ""
@ -55,7 +55,7 @@ msgstr ""
msgid "File to insert [from ./] " msgid "File to insert [from ./] "
msgstr "" msgstr ""
#: files.c:272 files.c:296 files.c:486 nano.c:1147 #: files.c:272 files.c:296 files.c:486 nano.c:1149
msgid "Cancelled" msgid "Cancelled"
msgstr "" msgstr ""
@ -571,90 +571,90 @@ msgstr ""
msgid "Mark UNset" msgid "Mark UNset"
msgstr "" msgstr ""
#: nano.c:873 #: nano.c:875
#, c-format #, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n" msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr "" msgstr ""
#: nano.c:933 #: nano.c:935
#, c-format #, c-format
msgid "current->data now = \"%s\"\n" msgid "current->data now = \"%s\"\n"
msgstr "" msgstr ""
#: nano.c:986 #: nano.c:988
#, c-format #, c-format
msgid "After, data = \"%s\"\n" msgid "After, data = \"%s\"\n"
msgstr "" msgstr ""
#: nano.c:1056 #: nano.c:1058
msgid "Error deleting tempfile, ack!" msgid "Error deleting tempfile, ack!"
msgstr "" msgstr ""
#: nano.c:1074 #: nano.c:1076
#, c-format #, c-format
msgid "Could not create a temporary filename: %s" msgid "Could not create a temporary filename: %s"
msgstr "" msgstr ""
#: nano.c:1097 #: nano.c:1099
#, c-format #, c-format
msgid "Could not invoke spell program \"%s\"" msgid "Could not invoke spell program \"%s\""
msgstr "" msgstr ""
#. Why 32512? I dont know! #. Why 32512? I dont know!
#: nano.c:1103 #: nano.c:1105
msgid "Could not invoke \"ispell\"" msgid "Could not invoke \"ispell\""
msgstr "" msgstr ""
#: nano.c:1116 #: nano.c:1118
msgid "Finished checking spelling" msgid "Finished checking spelling"
msgstr "" msgstr ""
#: nano.c:1134 #: nano.c:1136
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? " msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr "" msgstr ""
#: nano.c:1257 #: nano.c:1259
msgid "Cannot resize top win" msgid "Cannot resize top win"
msgstr "" msgstr ""
#: nano.c:1259 #: nano.c:1261
msgid "Cannot move top win" msgid "Cannot move top win"
msgstr "" msgstr ""
#: nano.c:1261 #: nano.c:1263
msgid "Cannot resize edit win" msgid "Cannot resize edit win"
msgstr "" msgstr ""
#: nano.c:1263 #: nano.c:1265
msgid "Cannot move edit win" msgid "Cannot move edit win"
msgstr "" msgstr ""
#: nano.c:1265 #: nano.c:1267
msgid "Cannot resize bottom win" msgid "Cannot resize bottom win"
msgstr "" msgstr ""
#: nano.c:1267 #: nano.c:1269
msgid "Cannot move bottom win" msgid "Cannot move bottom win"
msgstr "" msgstr ""
#: nano.c:1736 #: nano.c:1742
msgid "Main: set up windows\n" msgid "Main: set up windows\n"
msgstr "" msgstr ""
#: nano.c:1758 #: nano.c:1764
msgid "Main: bottom win\n" msgid "Main: bottom win\n"
msgstr "" msgstr ""
#: nano.c:1764 #: nano.c:1770
msgid "Main: open file\n" msgid "Main: open file\n"
msgstr "" msgstr ""
#: nano.c:1837 #: nano.c:1843
#, c-format #, c-format
msgid "I got Alt-[-%c! (%d)\n" msgid "I got Alt-[-%c! (%d)\n"
msgstr "" msgstr ""
#: nano.c:1853 #: nano.c:1859
#, c-format #, c-format
msgid "I got Alt-%c! (%d)\n" msgid "I got Alt-%c! (%d)\n"
msgstr "" msgstr ""