diff --git a/ChangeLog b/ChangeLog
index 999940925ba022d80f4b23f38d8400314437fde9..d72b718d0a108f8d8fe58a3e33eabb39ab55cd00 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-27  Mark Majeres  <mark@engine12.com>
+	* src/text.c (do_alt_speller): Adjust the end point of the marked
+	region for any change in length of the region's last line.
+
 2015-03-27  Benno Schulenberg  <bensberg@justemail.net>
 	* doc/syntax/patch.nanorc: Recognize also Debian package diffs.
 	Fixes https://bugs.launchpad.net/ubuntu/+source/nano/+bug/1300565
diff --git a/src/text.c b/src/text.c
index 98b2f802c025e28b94bc2e01c1f0b23b93e4f8f6..14ca49e82a4a836b8f53bed42c90e35ef6fe720d 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2675,6 +2675,7 @@ const char *do_alt_speller(char *tempfile_name)
 	/* Whether we added a magicline after filebot. */
     filestruct *top, *bot;
     size_t top_x, bot_x;
+    bool right_side_up = FALSE;
     ssize_t mb_lineno_save = 0;
 	/* We're going to close the current file, and open the output of
 	 * the alternate spell command.  The line that mark_begin points
@@ -2779,7 +2780,7 @@ const char *do_alt_speller(char *tempfile_name)
 	 * added when we're done correcting misspelled words; and
 	 * turn the mark off. */
 	mark_order((const filestruct **)&top, &top_x,
-		(const filestruct **)&bot, &bot_x, NULL);
+		(const filestruct **)&bot, &bot_x, &right_side_up);
 	filepart = partition_filestruct(top, top_x, bot, bot_x);
 	if (!ISSET(NO_NEWLINES))
 	    added_magicline = (openfile->filebot->data[0] != '\0');
@@ -2797,6 +2798,12 @@ const char *do_alt_speller(char *tempfile_name)
 #ifndef NANO_TINY
     if (old_mark_set) {
 	filestruct *top_save = openfile->fileage;
+	/* Adjust the end point of the marked region for any change in
+	   length of the region's last line. */
+	if (right_side_up)
+	    current_x_save = strlen(openfile->filebot->data);
+	else
+	    openfile->mark_begin_x = strlen(openfile->filebot->data);
 
 	/* If the mark was on, the NO_NEWLINES flag isn't set, and we
 	 * added a magicline, remove it now. */
@@ -2818,13 +2825,7 @@ const char *do_alt_speller(char *tempfile_name)
 	openfile->totsize = totsize_save;
 
 	/* Assign mark_begin to the line where the mark began before. */
-	goto_line_posx(mb_lineno_save, openfile->mark_begin_x);
-	openfile->mark_begin = openfile->current;
-
-	/* Assign mark_begin_x to the location in mark_begin where the
-	 * mark began before, adjusted for any shortening of the
-	 * line. */
-	openfile->mark_begin_x = openfile->current_x;
+	openfile->mark_begin = fsfromline(mb_lineno_save);
 
 	/* Turn the mark back on. */
 	openfile->mark_set = TRUE;