Adjusting some comments.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5308 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2015-07-18 10:32:01 +00:00
parent 3f1878d9a9
commit 74e7521478
4 changed files with 20 additions and 22 deletions

View File

@ -2,6 +2,7 @@
* src/winio.c (edit_draw): When looking for multiline-regex matches, * src/winio.c (edit_draw): When looking for multiline-regex matches,
look for a new start only after an end, instead of right after the look for a new start only after an end, instead of right after the
last start. This fixes bug #45525 and bug #41313 on Savannah. last start. This fixes bug #45525 and bug #41313 on Savannah.
* src/nano.c, src/text.c, src/winio.c: Adjust some comments.
2015-07-17 Benno Schulenberg <bensberg@justemail.net> 2015-07-17 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (open_buffer): Verify that a named and existing file * src/files.c (open_buffer): Verify that a named and existing file

View File

@ -2511,7 +2511,7 @@ int main(int argc, char **argv)
#endif /* !DISABLE_NANORC */ #endif /* !DISABLE_NANORC */
#ifndef DISABLE_WRAPPING #ifndef DISABLE_WRAPPING
/* Overwrite an rcfile "set nowrap" or --disable-wrapping-as-root /* Override an rcfile "set nowrap" or --disable-wrapping-as-root
* if a --fill option was given on the command line. */ * if a --fill option was given on the command line. */
if (fill_used) if (fill_used)
UNSET(NO_WRAP); UNSET(NO_WRAP);

View File

@ -2357,16 +2357,16 @@ bool do_int_spell_fix(const char *word)
#ifndef NANO_TINY #ifndef NANO_TINY
if (old_mark_set) { if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it /* Trim the filestruct so that it contains only the marked text. */
* 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. */
mark_order((const filestruct **)&top, &top_x, mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up); (const filestruct **)&bot, &bot_x, &right_side_up);
filepart = partition_filestruct(top, top_x, bot, bot_x); filepart = partition_filestruct(top, top_x, bot, bot_x);
/* Foresay whether spell correction will add a magicline. */
if (!ISSET(NO_NEWLINES)) if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0'); added_magicline = (openfile->filebot->data[0] != '\0');
/* Turn the mark off. */
openfile->mark_set = FALSE; openfile->mark_set = FALSE;
} }
#endif #endif
@ -2749,13 +2749,13 @@ const char *do_alt_speller(char *tempfile_name)
#ifndef NANO_TINY #ifndef NANO_TINY
if (old_mark_set) { if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it /* Trim the filestruct so that it contains only the marked text. */
* 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. */
mark_order((const filestruct **)&top, &top_x, mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, &right_side_up); (const filestruct **)&bot, &bot_x, &right_side_up);
filepart = partition_filestruct(top, top_x, bot, bot_x); 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)) if (!ISSET(NO_NEWLINES))
added_magicline = (openfile->filebot->data[0] != '\0'); added_magicline = (openfile->filebot->data[0] != '\0');
@ -3357,9 +3357,9 @@ void do_wordlinechar_count(void)
filestruct *top, *bot; filestruct *top, *bot;
size_t top_x, bot_x; size_t top_x, bot_x;
if (old_mark_set) {
/* If the mark is on, partition the filestruct so that it /* If the mark is on, partition the filestruct so that it
* contains only the marked text, and turn the mark off. */ * contains only the marked text, and turn the mark off. */
if (old_mark_set) {
mark_order((const filestruct **)&top, &top_x, mark_order((const filestruct **)&top, &top_x,
(const filestruct **)&bot, &bot_x, NULL); (const filestruct **)&bot, &bot_x, NULL);
filepart = partition_filestruct(top, top_x, bot, bot_x); filepart = partition_filestruct(top, top_x, bot, bot_x);
@ -3384,8 +3384,7 @@ void do_wordlinechar_count(void)
/* Get the total line and character counts, as "wc -l" and "wc -c" /* Get the total line and character counts, as "wc -l" and "wc -c"
* do, but get the latter in multibyte characters. */ * do, but get the latter in multibyte characters. */
if (old_mark_set) { if (old_mark_set) {
nlines = openfile->filebot->lineno - nlines = openfile->filebot->lineno - openfile->fileage->lineno + 1;
openfile->fileage->lineno + 1;
chars = get_totsize(openfile->fileage, openfile->filebot); chars = get_totsize(openfile->fileage, openfile->filebot);
/* Unpartition the filestruct so that it contains all the text /* Unpartition the filestruct so that it contains all the text
@ -3402,8 +3401,7 @@ void do_wordlinechar_count(void)
openfile->current_x = current_x_save; openfile->current_x = current_x_save;
openfile->placewewant = pww_save; openfile->placewewant = pww_save;
/* Display the total word, line, and character counts on the /* Display the total word, line, and character counts on the statusbar. */
* statusbar. */
statusbar(_("%sWords: %lu Lines: %ld Chars: %lu"), old_mark_set ? statusbar(_("%sWords: %lu Lines: %ld Chars: %lu"), old_mark_set ?
_("In Selection: ") : "", (unsigned long)words, (long)nlines, _("In Selection: ") : "", (unsigned long)words, (long)nlines,
(unsigned long)chars); (unsigned long)chars);

View File

@ -2611,7 +2611,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
if (startmatch.rm_so == startmatch.rm_eo) if (startmatch.rm_so == startmatch.rm_eo)
startmatch.rm_eo++; startmatch.rm_eo++;
else { else {
/* No start found, so skip to the next step. */ /* If no start was found, skip to the next step. */
if (start_line == NULL) if (start_line == NULL)
goto step_two; goto step_two;
/* Now start_line is the first line before fileptr /* Now start_line is the first line before fileptr
@ -2646,7 +2646,7 @@ void edit_draw(filestruct *fileptr, const char *converted, int
end_line->data, 1, &endmatch, 0) == REG_NOMATCH) end_line->data, 1, &endmatch, 0) == REG_NOMATCH)
end_line = end_line->next; 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 && if (end_line == NULL || (end_line == fileptr &&
endmatch.rm_eo <= startpos)) endmatch.rm_eo <= startpos))
goto step_two; goto step_two;
@ -2747,13 +2747,12 @@ void edit_draw(filestruct *fileptr, const char *converted, int
mvwaddnstr(edit, line, x_start, mvwaddnstr(edit, line, x_start,
converted + index, -1); converted + index, -1);
/* We painted to the end of the line, so fileptr->multidata[tmpcolor->id] = CENDAFTER;
* don't bother checking any more
* starts. */
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, " Marking for id %i line %i as CENDAFTER\n", tmpcolor->id, line); fprintf(stderr, " Marking for id %i line %i as CENDAFTER\n", tmpcolor->id, line);
#endif #endif
fileptr->multidata[tmpcolor->id] = CENDAFTER; /* We painted to the end of the line, so
* don't bother checking any more starts. */
break; break;
} }
start_col = startmatch.rm_so + 1; start_col = startmatch.rm_so + 1;