diff --git a/ChangeLog b/ChangeLog
index 575b4ce0d6a34517d2ffe94f3da70b00290945b7..0ccb5a15d14fc5980965470b48b3571d179291db 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,12 @@ CVS code -
 	  do_home(), do_end(), do_up(), do_scroll_up(), do_down(),
 	  do_scroll_down(), do_left(), do_right(), do_indent_marked(),
 	  and get_kbinput(). (Benno Schulenberg, minor tweaks by DLR)
+	- Handle prepending of wrapped text in one place instead of
+	  many, so that it always works consistently.  Changes to
+	  do_uncut_text(), do_insertfile(), do_page_up(),
+	  do_page_down(), do_up(), do_scroll_up(), do_down(),
+	  do_scroll_down(), do_input(), do_search(), do_research(), and
+	  do_delete(). (DLR)
 - browser.c:
   do_browser()
 	- Reference NANO_GOTODIR_(ALT|F)?KEY instead of
diff --git a/src/cut.c b/src/cut.c
index 94c6f98cd1c02e80d363c5d84685a094efcd6e04..57edaa0411a75b00d71098a3b873b8b9f19ad8cc 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -248,10 +248,6 @@ void do_uncut_text(void)
 {
     assert(openfile->current != NULL && openfile->current->data != NULL);
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If the cutbuffer is empty, get out. */
     if (cutbuffer == NULL)
 	return;
diff --git a/src/files.c b/src/files.c
index d87564acd380c0ab37709da1959587312e6dd4e9..2dfb0218311862c5ab9c6a17646a0e6efa170a04 100644
--- a/src/files.c
+++ b/src/files.c
@@ -687,10 +687,6 @@ void do_insertfile(
     bool at_edittop = FALSE;
 	/* Whether we're at the top of the edit window. */
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     while (TRUE) {
 #ifndef NANO_TINY
 	if (execute) {
diff --git a/src/move.c b/src/move.c
index da9aaa219caef24ace06bf523329725355989481..3af92a33a61d4fbbed8d63ac278bf5794f082693 100644
--- a/src/move.c
+++ b/src/move.c
@@ -58,10 +58,6 @@ void do_page_up(void)
 {
     int i;
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If there's less than a page of text left on the screen, put the
      * cursor at the beginning of the first line of the file, and then
      * update the edit window. */
@@ -97,10 +93,6 @@ void do_page_down(void)
 {
     int i;
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If there's less than a page of text left on the screen, put the
      * cursor at the beginning of the last line of the file, and then
      * update the edit window. */
@@ -482,10 +474,6 @@ void do_end(void)
 /* Move up one line. */
 void do_up(void)
 {
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If we're at the top of the file, get out. */
     if (openfile->current == openfile->fileage)
 	return;
@@ -520,10 +508,6 @@ void do_up(void)
 /* Scroll up one line without scrolling the cursor. */
 void do_scroll_up(void)
 {
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If the top of the file is onscreen, get out. */
     if (openfile->edittop == openfile->fileage)
 	return;
@@ -543,10 +527,6 @@ void do_scroll_up(void)
 /* Move down one line. */
 void do_down(void)
 {
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If we're at the bottom of the file, get out. */
     if (openfile->current == openfile->filebot)
 	return;
@@ -581,10 +561,6 @@ void do_down(void)
 /* Scroll down one line without scrolling the cursor. */
 void do_scroll_down(void)
 {
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     /* If we're at the bottom of the file, get out. */
     if (openfile->current == openfile->filebot)
 	return;
diff --git a/src/nano.c b/src/nano.c
index 406b1fe6d1375efdc2ab26d440f34b4e9d4fa3d5..14a9e42976bd6eeb8e89f07e251814834b3494fa 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1315,10 +1315,15 @@ int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
 
 	/* If we got a shortcut or toggle, or if there aren't any other
 	 * characters waiting after the one we read in, we need to
-	 * display all the characters in the input buffer if it isn't
+	 * output all the characters in the input buffer if it isn't
 	 * empty.  Note that it should be empty if we're in view
 	 * mode. */
 	 if (*s_or_t == TRUE || get_key_buffer_len() == 0) {
+	    /* If we got a shortcut or toggle, turn off prepending of
+	     * wrapped text. */
+	    if (*s_or_t == TRUE)
+		wrap_reset();
+
 	    if (kbinput != NULL) {
 		/* Display all the characters in the input buffer at
 		 * once, filtering out control characters. */
@@ -1451,7 +1456,7 @@ bool do_mouse(void)
 }
 #endif /* !DISABLE_MOUSE */
 
-/* The user typed ouuput_len multibyte characters.  Add them to the edit
+/* The user typed output_len multibyte characters.  Add them to the edit
  * buffer, filtering out all control characters if allow_cntrls is
  * TRUE. */
 void do_output(char *output, size_t output_len, bool allow_cntrls)
diff --git a/src/search.c b/src/search.c
index a61d04fcf8b6ce78503cc824e5e906b2d3653349..bb02e4a86e6eeded5567eabd1c57ca48a26861a3 100644
--- a/src/search.c
+++ b/src/search.c
@@ -425,19 +425,18 @@ void do_search(void)
     int i;
     bool didfind;
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     i = search_init(FALSE, FALSE);
-    if (i == -1)	/* Cancel, Go to Line, blank search string, or
-			 * regcomp() failed. */
+
+    if (i == -1)
+	/* Cancel, Go to Line, blank search string, or regcomp()
+	 * failed. */
 	search_replace_abort();
-    else if (i == -2)	/* Replace. */
+    else if (i == -2)
+	/* Replace. */
 	do_replace();
 #if !defined(NANO_TINY) || defined(HAVE_REGEX_H)
-    else if (i == 1)	/* Case Sensitive, Backwards, or Regexp search
-			 * toggle. */
+    else if (i == 1)
+	/* Case Sensitive, Backwards, or Regexp search toggle. */
 	do_search();
 #endif
 
@@ -507,10 +506,6 @@ void do_research(void)
     size_t old_pww = openfile->placewewant;
     bool didfind;
 
-#ifndef DISABLE_WRAPPING
-    wrap_reset();
-#endif
-
     search_init_globals();
 
     if (last_search[0] != '\0') {
@@ -888,15 +883,17 @@ void do_replace(void)
     }
 
     i = search_init(TRUE, FALSE);
-    if (i == -1) {		/* Cancel, Go to Line, blank search
-				 * string, or regcomp() failed. */
+    if (i == -1) {
+	/* Cancel, Go to Line, blank search string, or regcomp()
+	 * failed. */
 	search_replace_abort();
 	return;
-    } else if (i == -2) {	/* No Replace. */
+    } else if (i == -2) {
+	/* No Replace. */
 	do_search();
 	return;
-    } else if (i == 1)		/* Case Sensitive, Backwards, or Regexp
-				 * search toggle. */
+    } else if (i == 1)
+	/* Case Sensitive, Backwards, or Regexp search toggle. */
 	do_replace();
 
     if (i != 0)
diff --git a/src/text.c b/src/text.c
index ad09855cb028c57abf8f412de7784162d68bdfd6..ab941aa24bb324395ec0c1792eaa15fc6f39d9c9 100644
--- a/src/text.c
+++ b/src/text.c
@@ -124,9 +124,6 @@ void do_delete(void)
 	delete_node(foo);
 	renumber(openfile->current);
 	openfile->totsize--;
-#ifndef DISABLE_WRAPPING
-	wrap_reset();
-#endif
 
 	/* If the NO_NEWLINES flag isn't set, and text has been added to
 	 * the magicline as a result of deleting at the end of the line
@@ -519,7 +516,7 @@ bool execute_command(const char *command)
 #endif /* !NANO_TINY */
 
 #ifndef DISABLE_WRAPPING
-/* Clear the prepend_wrap flag.  We need to do this as soon as we do
+/* Unset the prepend_wrap flag.  We need to do this as soon as we do
  * something other than type text. */
 void wrap_reset(void)
 {