current_x = 0;
restart_para_search:
-/* Here we find the first line of the paragraph to search. If the
- * current line is in a paragraph, then we move back to the first line.
- * Otherwise we move to the first line that is in a paragraph. */
+ /* Here we find the first line of the paragraph to search. If the
+ * current line is in a paragraph, then we move back to the first
+ * line. Otherwise, we move to the first line that is in a
+ * paragraph. */
quote_len = quote_length(IFREG(current->data, &qreg));
indent_len = indent_length(current->data + quote_len);
/* Is this line the beginning of a paragraph, according to
* items 2), 5), or 4) above? If so, stop. */
if (current->prev->data[quote_len + temp_id_len] == '\0' ||
- (quote_len == 0 && indent_len > 0
+ (quote_len == 0 && indent_len > 0
#ifndef NANO_SMALL
- && !ISSET(AUTOINDENT)
+ && !ISSET(AUTOINDENT)
#endif
- ) ||
- !indents_match(current->prev->data + quote_len,
- temp_id_len, current->data + quote_len, indent_len))
+ ) || !indents_match(current->prev->data + quote_len,
+ temp_id_len, current->data + quote_len, indent_len))
break;
indent_len = temp_id_len;
current = current->prev;
/* There is no previous paragraph, so nothing to move to. */
if (current->prev == NULL) {
placewewant = 0;
- if (do_refresh) {
- if (current_y < 0)
- edit_update(current, CENTER);
- else
- edit_refresh();
- }
+ if (do_refresh)
+ edit_refresh();
#ifdef HAVE_REGEX_H
if (!do_restart)
regfree(&qreg);
} while (current->data[quote_len + indent_len] == '\0');
}
-/* Now current is the first line of the paragraph, and quote_len is the
- * quotation length of that line. */
+ /* Now current is the first line of the paragraph, and quote_len is
+ * the quotation length of that line. */
-/* Next step, compute par_len, the number of lines in this paragraph. */
+ /* Next step, compute par_len, the number of lines in this
+ * paragraph. */
line = current;
par_len = 1;
indent_len = indent_length(line->data + quote_len);
while (line->next != NULL && quotes_match(current->data, quote_len,
- IFREG(line->next->data, &qreg))) {
+ IFREG(line->next->data, &qreg))) {
size_t temp_id_len = indent_length(line->next->data + quote_len);
if (!indents_match(line->data + quote_len, indent_len,
- line->next->data + quote_len, temp_id_len) ||
+ line->next->data + quote_len, temp_id_len) ||
line->next->data[quote_len + temp_id_len] == '\0' ||
(quote_len == 0 && temp_id_len > 0
#ifndef NANO_SMALL
regfree(&qreg);
#endif
-/* Now par_len is the number of lines in this paragraph. We should
- * never call quotes_match() or quote_length() again. */
+ /* Now par_len is the number of lines in this paragraph. We should
+ * never call quotes_match() or quote_length() again. */
/* If we're searching for the end of the paragraph, move down the
* number of lines in the paragraph. */
}
/* Refresh the screen if needed. */
- if (do_refresh) {
- if (((search_type == 0 || search_type == 2) && current_y >
- editwinrows - 1) || (search_type == 1 && current_y < 0))
- edit_update(current, CENTER);
- else
- edit_refresh();
- }
+ if (do_refresh)
+ edit_refresh();
/* Save the values of quote_len, par_len, and indent_len if
* needed. */
splice_node(current, make_new_node(current), current->next);
/* In a non-quoted paragraph, we copy the indent
* only if AUTOINDENT is turned on. */
- if (quote_len == 0)
+ if (quote_len == 0
#ifndef NANO_SMALL
- if (!ISSET(AUTOINDENT))
+ && !ISSET(AUTOINDENT)
#endif
+ )
indent_len = 0;
current->next->data = charalloc(indent_len + line_len -
break_pos);
} /* while (TRUE) */
- if (current_y > editwinrows - 1)
- edit_update(current, CENTER);
- else
- edit_refresh();
+ edit_refresh();
statusbar(_("Can now UnJustify!"));
/* Display the shortcut list with UnJustify. */