tweaks: adjust some whitespace and a comment
Этот коммит содержится в:
родитель
9d5ee16614
Коммит
55b1403542
10
src/winio.c
10
src/winio.c
@ -2940,15 +2940,13 @@ void edit_refresh(void)
|
|||||||
/* Figure out what maxrows should really be. */
|
/* Figure out what maxrows should really be. */
|
||||||
compute_maxrows();
|
compute_maxrows();
|
||||||
|
|
||||||
|
/* If the current line is out of view, get it back on screen. */
|
||||||
if (openfile->current->lineno < openfile->edittop->lineno ||
|
if (openfile->current->lineno < openfile->edittop->lineno ||
|
||||||
openfile->current->lineno >= openfile->edittop->lineno +
|
openfile->current->lineno >= openfile->edittop->lineno + maxrows) {
|
||||||
maxrows) {
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
fprintf(stderr, "edit_refresh(): line = %ld, edittop %ld + maxrows %d\n",
|
fprintf(stderr, "edit_refresh(): line = %ld, edittop %ld + maxrows %d\n",
|
||||||
(long)openfile->current->lineno, (long)openfile->edittop->lineno, maxrows);
|
(long)openfile->current->lineno, (long)openfile->edittop->lineno, maxrows);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Make sure the current line is on the screen. */
|
|
||||||
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY);
|
adjust_viewport((focusing || !ISSET(SMOOTH_SCROLL)) ? CENTERING : STATIONARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2960,7 +2958,7 @@ void edit_refresh(void)
|
|||||||
|
|
||||||
for (nlines = 0; nlines < editwinrows && foo != NULL; nlines++) {
|
for (nlines = 0; nlines < editwinrows && foo != NULL; nlines++) {
|
||||||
nlines += update_line(foo, (foo == openfile->current) ?
|
nlines += update_line(foo, (foo == openfile->current) ?
|
||||||
openfile->current_x : 0);
|
openfile->current_x : 0);
|
||||||
foo = foo->next;
|
foo = foo->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3014,7 +3012,7 @@ void adjust_viewport(update_type manner)
|
|||||||
|
|
||||||
while (goal > 0 && openfile->edittop->prev != NULL) {
|
while (goal > 0 && openfile->edittop->prev != NULL) {
|
||||||
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) / editwincols;
|
goal -= strlenpt(openfile->edittop->data) / editwincols;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user