mirror of git://git.sv.gnu.org/nano.git
justify: set `x = 0` for the undo item, for when using --cutfromcursor
When --cutfromcursor is active, 'current_x' needs to be set to zero when
doing a justification, so that the correct starting position gets stored
in the undo item. (Without --cutfromcursor, the value of 'current_x'
does not matter.)
This fixes https://savannah.gnu.org/bugs/?65317.
The issue was indirectly reported by `correctmost`.
Bug existed in this form since version 5.0, commit ae5a4ece
.
Between versions 4.0 and 5.0, nano would not eat a line but would
instead crash when undoing a justification that was done with the
cursor away from the left edge.
This commit is contained in:
parent
2c42aa3181
commit
24393c6563
|
@ -1871,7 +1871,8 @@ void justify_text(bool whole_buffer)
|
|||
#endif
|
||||
refresh_needed = TRUE;
|
||||
return;
|
||||
}
|
||||
} else
|
||||
openfile->current_x = 0;
|
||||
|
||||
/* Set the starting point of the paragraph. */
|
||||
startline = openfile->current;
|
||||
|
|
Loading…
Reference in New Issue