do_uncut_text()
- If uncutting more than one line of unmarked text at editbot,
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:
load_file()
- Remove unneeded wmove() call. (David Benbennick)
so that functions only used with tab completion are properly
#ifdef'ed out. (DLR)
- search.c:
+ do_search()
+ - Remove erroneously introduced near-duplicate call to
+ update_history(). (DLR)
print_replaced()
- Remove and replace with an equivalent ngettext() call. (DLR)
do_replace_loop()
{
filestruct *tmp = current, *fileptr = current;
filestruct *newbuf = NULL, *newend = NULL;
-#ifndef NANO_SMALL
char *tmpstr, *tmpstr2;
filestruct *hold = current;
-#endif
int i;
wrap_reset();
if (cutbuffer == NULL || fileptr == NULL)
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)
-#endif
{
newbuf = copy_filestruct(cutbuffer);
for (newend = newbuf; newend->next != NULL && newend != NULL;
}
/* Hook newbuf into fileptr */
-#ifndef NANO_SMALL
if (marked_cut != 0) {
int recenter_me = 0;
/* Should we eventually use edit_update(CENTER)? */
UNSET(KEEP_CUTBUFFER);
return 0;
}
-#endif
if (fileptr != fileage) {
tmp = fileptr->prev;
* abort, 0 on success, and 1 on rerun calling program. Return -2 to
* run opposite program (search -> replace, replace -> search).
*
- * replacing = 1 if we call from do_replace, 0 if called from do_search
- * func. */
+ * replacing = 1 if we call from do_replace(), 0 if called from
+ * do_search(). */
int search_init(int replacing)
{
int i = 0;
#ifndef NANO_SMALL
/* 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);
-#endif /* !NANO_SMALL */
-
search_last_line = 0;
didfind = findnextstr(FALSE, FALSE, current, current_x, answer);