From 4295baa5fe315dc01323468495ce485fdcf64969 Mon Sep 17 00:00:00 2001
From: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 20 Jan 2018 17:12:07 +0100
Subject: [PATCH] tweaks: transform a 'do' to a 'while', and reshuffle a
 comment

---
 src/text.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/text.c b/src/text.c
index 9e0bb109..72fbe8e8 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2435,23 +2435,24 @@ void do_justify(bool full_justify)
 	uncutfunc->desc = unjust_tag;
 	display_main_list();
 
-	/* Now get a keystroke and see if it's unjustify.  If not, put back
-	 * the keystroke and return. */
 #ifndef NANO_TINY
-	do {
+	kbinput = KEY_WINCH;
+
+	/* Now wait for the next keystroke. */
+	while (kbinput == KEY_WINCH)
 #endif
+	{
 		statusbar(_("Can now UnJustify!"));
 		place_the_cursor();
 		kbinput = do_input(FALSE);
-#ifndef NANO_TINY
-	} while (kbinput == KEY_WINCH);
-#endif
+	}
 
 	/* Unset the suppression flag after showing the Unjustify message. */
 	suppress_cursorpos = FALSE;
 
 	func = func_from_key(&kbinput);
 
+	/* If the keystroke was Unjustify or Undo, then undo the justification. */
 	if (func == do_uncut_text
 #ifndef NANO_TINY
 						|| func == do_undo
-- 
GitLab