nano.c:do_wrap() - Restore the wrapping behavior to the previous wrapping point behavior (pre 1.1.10) (David Benbennick)

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1279 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2002-09-19 23:19:34 +00:00
parent de852623ee
commit 67ca2aa874
22 changed files with 20178 additions and 21331 deletions

View File

@ -94,6 +94,8 @@ CVS code -
- Make sure wrapping is done properly when the number of - Make sure wrapping is done properly when the number of
characters on the line is exactly one over the limit. (David characters on the line is exactly one over the limit. (David
Benbennick) Benbennick)
- Restore the wrapping behavior to the previous wrapping
point behavior (pre 1.1.10) (David Benbennick).
do_alt_speller() do_alt_speller()
- Readd DLR's fix to preserve marking when using the alternate - Readd DLR's fix to preserve marking when using the alternate
spell checker; it was accidentally dropped. (David spell checker; it was accidentally dropped. (David

27
nano.c
View File

@ -1410,16 +1410,16 @@ int do_wrap(filestruct *inptr)
/* There are three steps. First, we decide where to wrap. Then, we /* There are three steps. First, we decide where to wrap. Then, we
* create the new wrap line. Finally, we clean up. */ * create the new wrap line. Finally, we clean up. */
/* Step 1, finding where to wrap. We are going to replace a white-space /* Step 1, finding where to wrap. We are going to add a new-line
* character with a new-line. In this step, we set wrap_loc as the * after a white-space character. In this step, we set wrap_loc as the
* location of this replacement. * location of this replacement.
* *
* Where should we break the line? We need the last "legal wrap point" * Where should we break the line? We need the last "legal wrap point"
* such that the last word before it ended at or before fill. If there * such that the last word before it ended at or before fill. If there
* is no such point, we settle for the first legal wrap point. * is no such point, we settle for the first legal wrap point.
* *
* A "legal wrap point" is a white-space character that is not the last * A "legal wrap point" is a white-space character that is not followed by
* typed character and is not followed by white-space. * white-space.
* *
* If there is no legal wrap point or we found the last character of the * If there is no legal wrap point or we found the last character of the
* line, we should return without wrapping. * line, we should return without wrapping.
@ -1444,8 +1444,7 @@ int do_wrap(filestruct *inptr)
if (wrap_loc != -1 && strnlenpt(inptr->data, word_back + 1) > fill) if (wrap_loc != -1 && strnlenpt(inptr->data, word_back + 1) > fill)
break; break;
/* we record the latest "legal wrap point" */ /* we record the latest "legal wrap point" */
if (i != current_x - 1 && word_back != i && if (word_back != i && wrap_line[1] != ' ' && wrap_line[1] != '\t')
wrap_line[1] != ' ' && wrap_line[1] != '\t')
wrap_loc = i; wrap_loc = i;
} }
if (wrap_loc < 0 || i == len) if (wrap_loc < 0 || i == len)
@ -1504,12 +1503,13 @@ int do_wrap(filestruct *inptr)
} }
#endif #endif
strcat(newline, after_break); strcat(newline, after_break);
/* We end the old line at wrap_loc. Note this eats the space. */ /* We end the old line after wrap_loc. Note this does not eat the
null_at(&inptr->data, wrap_loc); space. */
null_at(&inptr->data, wrap_loc + 1);
totsize++;
if (wrapping) { if (wrapping) {
/* In this case, totsize does not change. We ate a space in the /* In this case, totsize increases by 1 since we add a space
* null_at() above, but we add a space between after_break and between after_break and wrap_line. */
* wrap_line below. */
strcat(newline, " "); strcat(newline, " ");
strcat(newline, wrap_line); strcat(newline, wrap_line);
free(inptr->next->data); free(inptr->next->data);
@ -1517,9 +1517,8 @@ int do_wrap(filestruct *inptr)
} else { } else {
filestruct *temp = (filestruct *)nmalloc(sizeof(filestruct)); filestruct *temp = (filestruct *)nmalloc(sizeof(filestruct));
/* In this case, the file size changes by -1 for the eaten /* In this case, the file size changes by +1 for the new line, and
* space, +1 for the new line, and +indent_len for the new +indent_len for the new indentation. */
* indentation. */
#ifndef NANO_SMALL #ifndef NANO_SMALL
totsize += indent_len; totsize += indent_len;
#endif #endif

2312
po/ca.po

File diff suppressed because it is too large Load Diff

1924
po/cs.po

File diff suppressed because it is too large Load Diff

2229
po/da.po

File diff suppressed because it is too large Load Diff

2245
po/de.po

File diff suppressed because it is too large Load Diff

2375
po/es.po

File diff suppressed because it is too large Load Diff

1790
po/fi.po

File diff suppressed because it is too large Load Diff

2257
po/fr.po

File diff suppressed because it is too large Load Diff

2313
po/gl.po

File diff suppressed because it is too large Load Diff

2095
po/hu.po

File diff suppressed because it is too large Load Diff

2077
po/id.po

File diff suppressed because it is too large Load Diff

2024
po/it.po

File diff suppressed because it is too large Load Diff

2219
po/ms.po

File diff suppressed because it is too large Load Diff

1800
po/nb.po

File diff suppressed because it is too large Load Diff

2098
po/nl.po

File diff suppressed because it is too large Load Diff

2073
po/nn.po

File diff suppressed because it is too large Load Diff

2221
po/pl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2174
po/ru.po

File diff suppressed because it is too large Load Diff

2311
po/sv.po

File diff suppressed because it is too large Load Diff

2194
po/uk.po

File diff suppressed because it is too large Load Diff