mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 04:41:21 +03:00
justify: set the correct starting point also with --cutfromcursor
When --cutfromcursor is active, 'current_x' does need to be zero for
the segment extraction to do the right thing.
This fixes https://savannah.gnu.org/bugs/?65289.
The issue was indirectly reported by `correctmost`.
Bug existed since version 4.0, commit 2500debb
.
This commit is contained in:
parent
20692e0c29
commit
0e44752ba1
@ -1849,8 +1849,10 @@ void justify_text(bool whole_buffer)
|
||||
{
|
||||
/* When justifying the entire buffer, start at the top. Otherwise, when
|
||||
* in a paragraph but not at its beginning, move back to its first line. */
|
||||
if (whole_buffer)
|
||||
if (whole_buffer) {
|
||||
openfile->current = openfile->filetop;
|
||||
openfile->current_x = 0;
|
||||
}
|
||||
else if (inpar(openfile->current) && !begpar(openfile->current, 0))
|
||||
do_para_begin(&openfile->current);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user