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.
master
Benno Schulenberg 2018-11-26 10:56:20 +01:00
parent ac8bd2a227
commit 6bead051d2
1 changed files with 5 additions and 5 deletions

View File

@ -2038,11 +2038,6 @@ bool find_paragraph(filestruct **firstline,
filestruct *line = *firstline; filestruct *line = *firstline;
/* The line of the current paragraph we're searching in. */ /* 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. */ /* When not currently in a paragraph, move forward to a line that is. */
while (!inpar(line) && line->next != NULL) while (!inpar(line) && line->next != NULL)
line = line->next; line = line->next;
@ -2213,6 +2208,11 @@ void do_justify(bool full_justify)
size_t was_current_x = openfile->current_x; size_t was_current_x = openfile->current_x;
#endif #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 /* 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. */ * in a paragraph but not at its beginning, move back to its first line. */
if (full_justify) if (full_justify)