Use nextln() in scroll()
This commit is contained in:
parent
ebf740f962
commit
cd9b149c8f
14
ed.c
14
ed.c
@ -841,14 +841,20 @@ join(void)
|
|||||||
static void
|
static void
|
||||||
scroll(int num)
|
scroll(int num)
|
||||||
{
|
{
|
||||||
int i;
|
int max, ln, cnt;
|
||||||
|
|
||||||
if (!line1 || line1 == lastln)
|
if (!line1 || line1 == lastln)
|
||||||
error("incorrect address");
|
error("incorrect address");
|
||||||
|
|
||||||
for (i = line1; i <= line1 + num && i <= lastln; ++i)
|
ln = line1;
|
||||||
fputs(gettxt(i), stdout);
|
max = line1 + num;
|
||||||
curln = i;
|
if (max > lastln)
|
||||||
|
max = lastln;
|
||||||
|
for (cnt = line1; cnt < max; cnt++) {
|
||||||
|
fputs(gettxt(ln), stdout);
|
||||||
|
ln = nextln(ln);
|
||||||
|
}
|
||||||
|
curln = ln;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user