diff --git a/src/nano.c b/src/nano.c
index e923150a2bbe21d215986774cfcbd9ae154f8af1..0d0c23ea1fe3d2933d0fe0f2849a7f762a997c52 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1743,9 +1743,9 @@ bool do_mouse(void)
 		openfile->current->prev != NULL; openfile->current_y--)
 		openfile->current = openfile->current->prev;
 
-	    openfile->placewewant = xplustabs();
 	    openfile->current_x = actual_x(openfile->current->data,
-		get_page_start(openfile->placewewant + mouse_x));
+		get_page_start(xplustabs() + mouse_x));
+	    openfile->placewewant = xplustabs();
 
 #ifndef NANO_SMALL
 	    /* Clicking where the cursor is toggles the mark, as does