commit 6bead051d2404ce5d1fad6b721658e70e2c60d5f
parent ac8bd2a227c400204333e6bf668b750ace5530e1
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 26 Nov 2018 10:56:20 +0100
justify: move the check for a bad quoting regex to a better place
So that the cursor will not move when a justification is attempted.
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2038,11 +2038,6 @@ bool find_paragraph(filestruct **firstline,
filestruct *line = *firstline;
/* The line of the current paragraph we're searching in. */
- if (quoterc != 0) {
- statusline(ALERT, _("Bad quote string %s: %s"), quotestr, quoteerr);
- return FALSE;
- }
-
/* When not currently in a paragraph, move forward to a line that is. */
while (!inpar(line) && line->next != NULL)
line = line->next;
@@ -2213,6 +2208,11 @@ void do_justify(bool full_justify)
size_t was_current_x = openfile->current_x;
#endif
+ if (quoterc != 0) {
+ statusline(ALERT, _("Bad quoting regex %s: %s"), quotestr, quoteerr);
+ return;
+ }
+
/* When justifying the entire buffer, start at the top. Otherwise, when
* in a paragraph but not at its beginning, move back to its first line. */
if (full_justify)