mirror of git://git.sv.gnu.org/nano.git
softwrap: adjust start-of-screen when the 'edittop' line is hard-wrapped
When one or more chunks of the current line are above the viewport,
and this line gets hard-wrapped, then 'edittop' needs to be advanced,
otherwise the first row could be blank -- representing a chunk that
doesn't exist any more.
This fixes https://savannah.gnu.org/bugs/?65604.
The issue was reported by `correctmost`.
Bug existed since version 2.8.6, commit e375995d
.
This commit is contained in:
parent
c02aec557c
commit
7b07e1ee5c
|
@ -1339,6 +1339,12 @@ void do_wrap(void)
|
|||
/* Now split the line. */
|
||||
do_enter();
|
||||
|
||||
#ifndef NANO_TINY
|
||||
/* When wrapping a partially visible line, adjust start-of-screen. */
|
||||
if (openfile->edittop == line && openfile->firstcolumn > 0 && cursor_x >= wrap_loc)
|
||||
go_forward_chunks(1, &openfile->edittop, &openfile->firstcolumn);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_JUSTIFY
|
||||
/* If the original line has quoting, copy it to the spillage line. */
|
||||
if (quot_len > 0) {
|
||||
|
|
Loading…
Reference in New Issue