From dc2dca6b558b6fe0cf45524051002a40085d86e5 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 10 Sep 2018 17:55:01 -0500
Subject: [PATCH 2/3] tweaks: adjust the indentations after the previous change

And condense a couple of comments.
---
 src/text.c | 78 ++++++++++++++++++++++++++----------------------------
 1 file changed, 37 insertions(+), 41 deletions(-)

diff --git a/src/text.c b/src/text.c
index a8ab3211..8196b4ba 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2271,23 +2271,21 @@ void do_justify(bool full_justify)
 	if (!openfile->mark)
 #endif
 	{
-	/* If we're justifying the entire file, start at the beginning. */
-	if (full_justify) {
-		openfile->current = openfile->fileage;
-		openfile->current_x = 0;
-	}
+		/* If we're justifying the entire file, start at the beginning. */
+		if (full_justify) {
+			openfile->current = openfile->fileage;
+			openfile->current_x = 0;
+		}
 
-	/* Find the first line of the paragraph(s) to be justified.
-	 * If the search failed, it means that there are no paragraph(s) to
-	 * justify.  The search put us on the last line of the file, so
-	 * put the cursor at the end of it.  Then
-	 * refresh the screen and get out. */
-	if (!find_paragraph(&openfile->current, &filebot_inpar, &quote_len,
-						&par_len)) {
-		openfile->current_x = strlen(openfile->filebot->data);
-		refresh_needed = TRUE;
-		return;
-	}
+		/* Find the first line of the paragraph(s) to be justified.  If the
+		 * search fails, there is nothing to justify, and we will be on the
+		 * last line of the file, so put the cursor at the end of it. */
+		if (!find_paragraph(&openfile->current, &filebot_inpar, &quote_len,
+							&par_len)) {
+			openfile->current_x = strlen(openfile->filebot->data);
+			refresh_needed = TRUE;
+			return;
+		}
 	}
 
 	/* Prepare to put the text we want to justify in the cutbuffer. */
@@ -2319,28 +2317,27 @@ void do_justify(bool full_justify)
 		size_t jus_len;
 			/* The number of lines we're storing in the current cutbuffer. */
 
-	/* Set
-	 * first_par_line and last_par_line to the first line of the paragraph. */
-	first_par_line = openfile->current;
-	last_par_line = openfile->current;
+		/* Start out at the first line of the paragraph. */
+		first_par_line = openfile->current;
+		last_par_line = openfile->current;
 
-	/* If we're justifying the entire file, move last_par_line down to the
-	 * last line of the file (counting the text at filebot).  Otherwise, move
-	 * last_par_line down to the last line of the paragraph. */
-	if (full_justify) {
-		jus_len = openfile->filebot->lineno - first_par_line->lineno;
+		/* If we're justifying the entire file, move last_par_line down to the
+		 * last line of the file (counting the text at filebot).  Otherwise,
+		 * move last_par_line down to the last line of the paragraph. */
+		if (full_justify) {
+			jus_len = openfile->filebot->lineno - first_par_line->lineno;
 
-		if (openfile->filebot->data[0] != '\0') {
-			jus_len++;
-			filebot_inpar = TRUE;
-		}
-	} else
-		jus_len = par_len;
+			if (openfile->filebot->data[0] != '\0') {
+				jus_len++;
+				filebot_inpar = TRUE;
+			}
+		} else
+			jus_len = par_len;
 
-	while (jus_len > 0 && last_par_line->next != NULL) {
-		last_par_line = last_par_line->next;
-		jus_len--;
-	}
+		while (jus_len > 0 && last_par_line->next != NULL) {
+			last_par_line = last_par_line->next;
+			jus_len--;
+		}
 
 		if (filebot_inpar)
 			bot_x = strlen(last_par_line->data);
@@ -2373,12 +2370,11 @@ void do_justify(bool full_justify)
 	if (!openfile->mark)
 #endif
 	{
-	/* If we're justifying the entire file, search for and justify paragraphs
-	 * until we can't anymore. */
-	if (full_justify) {
-		while (find_paragraph(&jusline, &filebot_inpar, &quote_len, &par_len))
-			justify_paragraph(&jusline, quote_len, par_len);
-	}
+		/* When justifying the entire file, find and justify all paragraphs. */
+		if (full_justify) {
+			while (find_paragraph(&jusline, &filebot_inpar, &quote_len, &par_len))
+				justify_paragraph(&jusline, quote_len, par_len);
+		}
 	}
 
 #ifndef NANO_TINY
-- 
2.19.1

