diff options
Diffstat (limited to 'contrib/nvi')
-rw-r--r-- | contrib/nvi/vi/vs_line.c | 5 | ||||
-rw-r--r-- | contrib/nvi/vi/vs_smap.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/contrib/nvi/vi/vs_line.c b/contrib/nvi/vi/vs_line.c index b439de9..e48d5ef 100644 --- a/contrib/nvi/vi/vs_line.c +++ b/contrib/nvi/vi/vs_line.c @@ -267,7 +267,10 @@ empty: (void)gp->scr_addstr(sp, cols_per_screen = sp->cols; /* Put starting info for this line in the cache. */ - if (scno != skip_cols) { + if (offset_in_line >= len) { + smp->c_sboff = offset_in_line; + smp->c_scoff = 255; + } else if (scno != skip_cols) { smp->c_sboff = offset_in_line; smp->c_scoff = offset_in_char = chlen - (scno - skip_cols); diff --git a/contrib/nvi/vi/vs_smap.c b/contrib/nvi/vi/vs_smap.c index af38057..18d7942 100644 --- a/contrib/nvi/vi/vs_smap.c +++ b/contrib/nvi/vi/vs_smap.c @@ -743,7 +743,7 @@ vs_sm_up(sp, rp, count, scmd, smp) if (!SMAP_CACHE(smp) && vs_line(sp, smp, NULL, NULL)) return (1); rp->lno = smp->lno; - rp->cno = smp->c_sboff; + rp->cno = smp->c_scoff == 255 ? 0 : smp->c_sboff; return (0); } @@ -958,7 +958,7 @@ vs_sm_down(sp, rp, count, scmd, smp) if (!SMAP_CACHE(smp) && vs_line(sp, smp, NULL, NULL)) return (1); rp->lno = smp->lno; - rp->cno = smp->c_sboff; + rp->cno = smp->c_scoff == 255 ? 0 : smp->c_sboff; return (0); } |