version 1.24, 2013/05/19 10:27:11 |
version 1.25, 2013/06/01 09:46:31 |
|
|
int |
int |
gotoeop(int f, int n) |
gotoeop(int f, int n) |
{ |
{ |
|
int col; |
|
int nospace; |
|
|
/* the other way... */ |
/* the other way... */ |
if (n < 0) |
if (n < 0) |
return (gotobop(f, -n)); |
return (gotobop(f, -n)); |
|
|
/* for each one asked for */ |
/* for each one asked for */ |
while (n-- > 0) { |
while (n-- > 0) { |
/* Find the first word on/after the current line */ |
while (lforw(curwp->w_dotp) != curbp->b_headp) { |
curwp->w_doto = 0; |
col = 0; |
while (forwchar(FFRAND, 1) && inword() == 0); |
curwp->w_doto = 0; |
|
|
curwp->w_doto = 0; |
while (col < llength(curwp->w_dotp) && |
curwp->w_dotp = lforw(curwp->w_dotp); |
(isspace(lgetc(curwp->w_dotp, col)))) |
|
col++; |
|
|
/* and scan forword until we hit a <NL><SP> or ... */ |
if (col >= llength(curwp->w_dotp)) { |
while (curwp->w_dotp != curbp->b_headp) { |
if (nospace) |
if (llength(curwp->w_dotp) && |
break; |
lgetc(curwp->w_dotp, 0) != ' ' && |
|
lgetc(curwp->w_dotp, 0) != '.' && |
|
lgetc(curwp->w_dotp, 0) != '\t') { |
|
curwp->w_dotp = lforw(curwp->w_dotp); |
|
curwp->w_dotline++; |
|
} else |
} else |
break; |
nospace = 1; |
} |
|
if (curwp->w_dotp == curbp->b_headp) { |
curwp->w_dotp = lforw(curwp->w_dotp); |
/* beyond end of buffer, cleanup time */ |
|
curwp->w_dotp = lback(curwp->w_dotp); |
|
curwp->w_doto = llength(curwp->w_dotp); |
|
break; |
|
} else |
|
curwp->w_dotline++; |
curwp->w_dotline++; |
|
} |
|
nospace = 0; |
} |
} |
/* force screen update */ |
/* force screen update */ |
curwp->w_rflag |= WFMOVE; |
curwp->w_rflag |= WFMOVE; |