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-d3aeb78583b8master
parent
de852623ee
commit
67ca2aa874
|
@ -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
27
nano.c
|
@ -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
|
||||||
|
|
749
po/pt_BR.po
749
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue