/* ARGSUSED */ int backline(int f, int n) { struct line *dlp; if (n < 0) return (forwline(f | FFRAND, -n)); if ((lastflag & CFCPCN) == 0) /* Fix goal. */ setgoal(); thisflag |= CFCPCN; dlp = curwp->w_dotp; if (lback(dlp) == curbp->b_headp) { if (!(f & FFRAND)) { dobeep(); ewprintf("Beginning of buffer"); } return(TRUE); } while (n-- && lback(dlp) != curbp->b_headp) { dlp = lback(dlp); curwp->w_dotline--; } if (n > 0 && !(f & FFRAND)) { dobeep(); ewprintf("Beginning of buffer"); } curwp->w_dotp = dlp; curwp->w_doto = getgoal(dlp); curwp->w_rflag |= WFMOVE; return (TRUE); }
/* ARGSUSED */ int forwline(int f, int n) { struct line *dlp; if (n < 0) return (backline(f | FFRAND, -n)); if ((dlp = curwp->w_dotp) == curbp->b_headp) return(TRUE); if ((lastflag & CFCPCN) == 0) /* Fix goal. */ setgoal(); thisflag |= CFCPCN; if (n == 0) return (TRUE); while (n--) { dlp = lforw(dlp); if (dlp == curbp->b_headp) { curwp->w_dotp = lback(dlp); curwp->w_doto = llength(curwp->w_dotp); curwp->w_rflag |= WFMOVE; return (TRUE); } curwp->w_dotline++; } curwp->w_rflag |= WFMOVE; curwp->w_dotp = dlp; curwp->w_doto = getgoal(dlp); return (TRUE); }
/* ARGSUSED */ int backline(int f, int n) { struct line *dlp; if (n < 0) return (forwline(f | FFRAND, -n)); if ((lastflag & CFCPCN) == 0) /* Fix goal. */ setgoal(); thisflag |= CFCPCN; dlp = curwp->w_dotp; while (n-- && lback(dlp) != curbp->b_headp) { dlp = lback(dlp); curwp->w_dotline--; } curwp->w_dotp = dlp; curwp->w_doto = getgoal(dlp); curwp->w_rflag |= WFMOVE; return (TRUE); }