diff --git a/src/text.c b/src/text.c
index 7ef5d9530f4666ea44dadfd806a6043dbd19c72e..48717958d02dd0ca054e9dd8dbc035583e6f6506 100644
--- a/src/text.c
+++ b/src/text.c
@@ -303,13 +303,12 @@ void do_indent_marked(ssize_t len)
 	    if (f == openfile->current) {
 		openfile->current_x += line_indent_len;
 		openfile->mark_begin_x += line_indent_len;
-
-		/* If the NO_NEWLINES flag isn't set, and this is the
-		 * magicline, add a new magicline. */
-		if (!ISSET(NO_NEWLINES) && openfile->current ==
-			openfile->filebot)
-		    new_magicline();
 	    }
+
+	    /* If the NO_NEWLINES flag isn't set, and this is the
+	     * magicline, add a new magicline. */
+	    if (!ISSET(NO_NEWLINES) && f == openfile->filebot)
+		new_magicline();
 	}
     }