#ifndef NANO_TINY
if (old_mark_set) {
- /* If the mark is on, partition the filestruct so that it
- * contains only the marked text; if the NO_NEWLINES flag isn't
- * set, keep track of whether the text will have a magicline
- * added when we're done correcting misspelled words; and
- * turn the mark off. */
+ /* Trim the filestruct so that it contains only the marked text. */
mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up);
filepart = partition_filestruct(top, top_x, bot, bot_x);
+
+ /* Foresay whether spell correction will add a magicline. */
if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0');
+
+ /* Turn the mark off. */
openfile->mark_set = FALSE;
}
#endif
#ifndef NANO_TINY
if (old_mark_set) {
- /* If the mark is on, partition the filestruct so that it
- * contains only the marked text; if the NO_NEWLINES flag isn't
- * set, keep track of whether the text will have a magicline
- * added when we're done correcting misspelled words. */
+ /* Trim the filestruct so that it contains only the marked text. */
mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up);
filepart = partition_filestruct(top, top_x, bot, bot_x);
+
+ /* Foresay whether a magicline will be added when the
+ * spell-checked text is read back in. */
if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0');
filestruct *top, *bot;
size_t top_x, bot_x;
+ /* If the mark is on, partition the filestruct so that it
+ * contains only the marked text, and turn the mark off. */
if (old_mark_set) {
- /* If the mark is on, partition the filestruct so that it
- * contains only the marked text, and turn the mark off. */
mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, NULL);
filepart = partition_filestruct(top, top_x, bot, bot_x);
/* Get the total line and character counts, as "wc -l" and "wc -c"
* do, but get the latter in multibyte characters. */
if (old_mark_set) {
- nlines = openfile->filebot->lineno -
- openfile->fileage->lineno + 1;
+ nlines = openfile->filebot->lineno - openfile->fileage->lineno + 1;
chars = get_totsize(openfile->fileage, openfile->filebot);
/* Unpartition the filestruct so that it contains all the text
openfile->current_x = current_x_save;
openfile->placewewant = pww_save;
- /* Display the total word, line, and character counts on the
- * statusbar. */
+ /* Display the total word, line, and character counts on the statusbar. */
statusbar(_("%sWords: %lu Lines: %ld Chars: %lu"), old_mark_set ?
_("In Selection: ") : "", (unsigned long)words, (long)nlines,
(unsigned long)chars);
if (startmatch.rm_so == startmatch.rm_eo)
startmatch.rm_eo++;
else {
- /* No start found, so skip to the next step. */
+ /* If no start was found, skip to the next step. */
if (start_line == NULL)
goto step_two;
/* Now start_line is the first line before fileptr
end_line->data, 1, &endmatch, 0) == REG_NOMATCH)
end_line = end_line->next;
- /* No end found, or it is too early. */
+ /* If no end was found, or it is too early, next step. */
if (end_line == NULL || (end_line == fileptr &&
endmatch.rm_eo <= startpos))
goto step_two;
mvwaddnstr(edit, line, x_start,
converted + index, -1);
- /* We painted to the end of the line, so
- * don't bother checking any more
- * starts. */
+ fileptr->multidata[tmpcolor->id] = CENDAFTER;
#ifdef DEBUG
fprintf(stderr, " Marking for id %i line %i as CENDAFTER\n", tmpcolor->id, line);
#endif
- fileptr->multidata[tmpcolor->id] = CENDAFTER;
+ /* We painted to the end of the line, so
+ * don't bother checking any more starts. */
break;
}
start_col = startmatch.rm_so + 1;