in find_paragraph(), fix a problem where a search for the next paragraph
would skip over certain cases of one-line paragraphs git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2413 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
aad85151ae
commit
6b94e95ec9
|
@ -21,6 +21,9 @@ CVS code -
|
|||
- Fix erroneous #ifdef that resulted in the -d/--rebinddelete
|
||||
and -k/--cut options' not being printed when NANO_SMALL was
|
||||
defined. (DLR)
|
||||
find_paragraph()
|
||||
- Fix problem where a search for the next paragraph would skip
|
||||
over certain cases of one-line paragraphs. (DLR)
|
||||
do_justify()
|
||||
- Instead of breaking a line at a space and readding the space
|
||||
afterwards, just break the line after the space, as it's more
|
||||
|
|
13
src/nano.c
13
src/nano.c
|
@ -2887,17 +2887,20 @@ bool find_paragraph(size_t *const quote, size_t *const par)
|
|||
|
||||
/* Find the first line of the current or next paragraph. First, if
|
||||
* the current line isn't in a paragraph, move forward to the line
|
||||
* after the end of the next paragraph. If we end up on the same
|
||||
* line, or the line before that isn't in a paragraph, it means that
|
||||
* there aren't any paragraphs left, so get out. Otherwise, if the
|
||||
* current line is in a paragraph and it isn't the first line of
|
||||
* that paragraph, move back to the first line. */
|
||||
* after the last line of the next paragraph. If we end up on the
|
||||
* same line, or the line before that isn't in a paragraph, it means
|
||||
* that there aren't any paragraphs left, so get out. Otherwise,
|
||||
* move back to the last line of the paragraph. If the current line
|
||||
* is in a paragraph and it isn't the first line of that paragraph,
|
||||
* move back to the first line. */
|
||||
if (!inpar(current)) {
|
||||
filestruct *current_save = current;
|
||||
|
||||
do_para_end(FALSE);
|
||||
if (current == current_save || !inpar(current->prev))
|
||||
return FALSE;
|
||||
if (current->prev != NULL)
|
||||
current = current->prev;
|
||||
}
|
||||
if (!begpar(current))
|
||||
do_para_begin(FALSE);
|
||||
|
|
Loading…
Reference in New Issue