DLR's latest changes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1350 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2003-01-14 23:36:11 +00:00
parent ca7113afee
commit 688c8eb112
3 changed files with 20 additions and 14 deletions

View File

@ -69,6 +69,9 @@ Changes
do_uncut_text() do_uncut_text()
- If uncutting more than one line of unmarked text at editbot, - If uncutting more than one line of unmarked text at editbot,
don't center the screen, since Pico doesn't. (DLR) don't center the screen, since Pico doesn't. (DLR)
- If uncutting previously unmarked text, uncut to end if we're
not at the beginning of the line, and set placewewant to 0 if
we are. This matches Pico's behavior. (DLR)
- files.c: - files.c:
load_file() load_file()
- Remove unneeded wmove() call. (David Benbennick) - Remove unneeded wmove() call. (David Benbennick)
@ -162,6 +165,9 @@ Changes
so that functions only used with tab completion are properly so that functions only used with tab completion are properly
#ifdef'ed out. (DLR) #ifdef'ed out. (DLR)
- search.c: - search.c:
do_search()
- Remove erroneously introduced near-duplicate call to
update_history(). (DLR)
print_replaced() print_replaced()
- Remove and replace with an equivalent ngettext() call. (DLR) - Remove and replace with an equivalent ngettext() call. (DLR)
do_replace_loop() do_replace_loop()

17
cut.c
View File

@ -293,10 +293,8 @@ int do_uncut_text(void)
{ {
filestruct *tmp = current, *fileptr = current; filestruct *tmp = current, *fileptr = current;
filestruct *newbuf = NULL, *newend = NULL; filestruct *newbuf = NULL, *newend = NULL;
#ifndef NANO_SMALL
char *tmpstr, *tmpstr2; char *tmpstr, *tmpstr2;
filestruct *hold = current; filestruct *hold = current;
#endif
int i; int i;
wrap_reset(); wrap_reset();
@ -304,9 +302,18 @@ int do_uncut_text(void)
if (cutbuffer == NULL || fileptr == NULL) if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */ return 0; /* AIEEEEEEEEEEEE */
#ifndef NANO_SMALL /* If we're uncutting a previously non-marked block, uncut to end if
we're not at the beginning of the line. If we are at the
beginning of the line, set placewewant to 0. Pico does both of
these. */
if (marked_cut == 0) {
if (current_x != 0)
marked_cut = 2;
else
placewewant = 0;
}
if (marked_cut == 0 || cutbuffer->next != NULL) if (marked_cut == 0 || cutbuffer->next != NULL)
#endif
{ {
newbuf = copy_filestruct(cutbuffer); newbuf = copy_filestruct(cutbuffer);
for (newend = newbuf; newend->next != NULL && newend != NULL; for (newend = newbuf; newend->next != NULL && newend != NULL;
@ -315,7 +322,6 @@ int do_uncut_text(void)
} }
/* Hook newbuf into fileptr */ /* Hook newbuf into fileptr */
#ifndef NANO_SMALL
if (marked_cut != 0) { if (marked_cut != 0) {
int recenter_me = 0; int recenter_me = 0;
/* Should we eventually use edit_update(CENTER)? */ /* Should we eventually use edit_update(CENTER)? */
@ -424,7 +430,6 @@ int do_uncut_text(void)
UNSET(KEEP_CUTBUFFER); UNSET(KEEP_CUTBUFFER);
return 0; return 0;
} }
#endif
if (fileptr != fileage) { if (fileptr != fileage) {
tmp = fileptr->prev; tmp = fileptr->prev;

View File

@ -90,8 +90,8 @@ void search_init_globals(void)
* abort, 0 on success, and 1 on rerun calling program. Return -2 to * abort, 0 on success, and 1 on rerun calling program. Return -2 to
* run opposite program (search -> replace, replace -> search). * run opposite program (search -> replace, replace -> search).
* *
* replacing = 1 if we call from do_replace, 0 if called from do_search * replacing = 1 if we call from do_replace(), 0 if called from
* func. */ * do_search(). */
int search_init(int replacing) int search_init(int replacing)
{ {
int i = 0; int i = 0;
@ -399,12 +399,7 @@ int do_search(void)
#ifndef NANO_SMALL #ifndef NANO_SMALL
/* add this search string to the search history list */ /* add this search string to the search history list */
if (strcmp(answer, "")) if (answer[0] != '\0')
update_history(&search_history, answer);
#endif /* !NANO_SMALL */
#ifndef NANO_SMALL
/* add this search string to the search history list */
update_history(&search_history, answer); update_history(&search_history, answer);
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */