diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2019-01-24 15:09:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2019-01-24 15:09:42 +0000 |
commit | b459e1dc778beb6e06186f53ffeaea339c877667 (patch) | |
tree | ee104ff22854574841b4164da728e53e221b0949 /usr.bin/vi | |
parent | 8e5ae79256e987136029da0a26a29aa68bfc0193 (diff) |
Fix a crash on long lines when switching to another file by
setting SC_SCR_CENTER which will cause the offsets in HMAP to
be reset when painting the screen. OK martijn@ otto@
Diffstat (limited to 'usr.bin/vi')
-rw-r--r-- | usr.bin/vi/vi/vi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/vi/vi/vi.c b/usr.bin/vi/vi/vi.c index a8bfec9356d..9059ffe10e6 100644 --- a/usr.bin/vi/vi/vi.c +++ b/usr.bin/vi/vi/vi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vi.c,v 1.21 2017/04/18 01:45:35 deraadt Exp $ */ +/* $OpenBSD: vi.c,v 1.22 2019/01/24 15:09:41 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -395,6 +395,8 @@ intr: CLR_INTERRUPT(sp); /* If the last command switched files, change focus. */ if (F_ISSET(sp, SC_FSWITCH)) { F_CLR(sp, SC_FSWITCH); + F_CLR(sp, SC_SCR_TOP); + F_SET(sp, SC_SCR_CENTER); (void)sp->gp->scr_rename(sp, sp->frp->name, 1); } |