From 8041627cc3bf0bfdbf53bfb9e579ef8a4edc51db Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@justemail.net>
Date: Tue, 20 Sep 2016 12:53:12 +0200
Subject: [PATCH] tweaks: remove a bit of duplication

---
 src/move.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/move.c b/src/move.c
index bf3cfed9..7fe82b92 100644
--- a/src/move.c
+++ b/src/move.c
@@ -580,17 +580,14 @@ void do_right(void)
     if (openfile->current->data[openfile->current_x] != '\0')
 	openfile->current_x = move_mbright(openfile->current->data,
 						openfile->current_x);
-    else if (openfile->current != openfile->filebot) {
+    else if (openfile->current != openfile->filebot)
 	openfile->current_x = 0;
-	openfile->placewewant = 0;
-	if (need_horizontal_scroll(was_column, 0))
-	    update_line(openfile->current, 0);
-	do_down_void();
-	return;
-    }
 
     openfile->placewewant = xplustabs();
 
     if (need_horizontal_scroll(was_column, openfile->placewewant))
 	update_line(openfile->current, openfile->current_x);
+
+    if (openfile->current_x == 0)
+	do_down_void();
 }
-- 
GitLab