softwrap: scroll the current line fully into view when jumping words
This fixes https://savannah.gnu.org/bugs/?47710 and fixes https://savannah.gnu.org/bugs/?49088.
Этот коммит содержится в:
родитель
8ba57cf87b
Коммит
598e0af7af
12
src/winio.c
12
src/winio.c
@ -2970,8 +2970,13 @@ void edit_update(update_type manner)
|
|||||||
if (manner == CENTERING)
|
if (manner == CENTERING)
|
||||||
goal = editwinrows / 2;
|
goal = editwinrows / 2;
|
||||||
else if (manner == FLOWING) {
|
else if (manner == FLOWING) {
|
||||||
if (openfile->current->lineno >= openfile->edittop->lineno)
|
if (openfile->current->lineno >= openfile->edittop->lineno) {
|
||||||
goal = editwinrows - 1;
|
goal = editwinrows - 1;
|
||||||
|
#ifndef NANO_TINY
|
||||||
|
if (ISSET(SOFTWRAP))
|
||||||
|
goal -= strlenpt(openfile->current->data) / COLS ;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
goal = openfile->current_y;
|
goal = openfile->current_y;
|
||||||
|
|
||||||
@ -2986,8 +2991,11 @@ void edit_update(update_type manner)
|
|||||||
openfile->edittop = openfile->edittop->prev;
|
openfile->edittop = openfile->edittop->prev;
|
||||||
goal --;
|
goal --;
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (ISSET(SOFTWRAP))
|
if (ISSET(SOFTWRAP)) {
|
||||||
goal -= strlenpt(openfile->edittop->data) / COLS;
|
goal -= strlenpt(openfile->edittop->data) / COLS;
|
||||||
|
if (goal < 0)
|
||||||
|
openfile->edittop = openfile->edittop->next;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user