From 7b7a25f3f892a05d6c0455d3b71e7c574c9bcf68 Mon Sep 17 00:00:00 2001 From: skimo Date: Thu, 11 Apr 2002 19:49:29 +0000 Subject: [PATCH] The fix in 10.55 of exf.c had unwanted side effects. Both vi +line file and switching between files, would make the current line the top line. This patch fixes this. --- common/exf.c | 7 +++++-- vi/vi.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/exf.c b/common/exf.c index a30501cc..0558e402 100644 --- a/common/exf.c +++ b/common/exf.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: exf.c,v 10.70 2002/03/02 23:36:22 skimo Exp $ (Berkeley) $Date: 2002/03/02 23:36:22 $"; +static const char sccsid[] = "$Id: exf.c,v 10.71 2002/04/11 19:49:29 skimo Exp $ (Berkeley) $Date: 2002/04/11 19:49:29 $"; #endif /* not lint */ #include @@ -474,7 +474,10 @@ no_lock: F_CLR(sp, SC_CONV_ERROR); /* Redraw the screen from scratch, schedule a welcome message. */ - F_SET(sp, SC_SCR_REFORMAT | SC_SCR_TOP | SC_STATUS); + F_SET(sp, SC_SCR_REFORMAT | SC_STATUS); + + if (frp->lno == OOBLNO) + F_SET(sp, SC_SCR_TOP); /* Append into the chain of file structures. */ if (ep->refcnt == 1) diff --git a/vi/vi.c b/vi/vi.c index d7bc6963..1200572e 100644 --- a/vi/vi.c +++ b/vi/vi.c @@ -10,7 +10,7 @@ #include "config.h" #ifndef lint -static const char sccsid[] = "$Id: vi.c,v 10.72 2001/06/25 15:19:37 skimo Exp $ (Berkeley) $Date: 2001/06/25 15:19:37 $"; +static const char sccsid[] = "$Id: vi.c,v 10.73 2002/04/11 19:49:30 skimo Exp $ (Berkeley) $Date: 2002/04/11 19:49:30 $"; #endif /* not lint */ #include @@ -999,6 +999,7 @@ v_init(SCR *sp) * line in the middle, otherwise, it won't work and we'll end up with * the line at the top. */ + F_CLR(sp, SC_SCR_TOP); F_SET(sp, SC_SCR_REFORMAT | SC_SCR_CENTER); /* Invalidate the cursor. */ -- 2.11.4.GIT