Date: Wed, 23 Oct 2013 14:15:46 +0000 (UTC) From: Aleksandr Rybalko <ray@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256970 - user/ed/newcons/sys/dev/vt Message-ID: <201310231415.r9NEFkXT003267@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ray Date: Wed Oct 23 14:15:46 2013 New Revision: 256970 URL: http://svnweb.freebsd.org/changeset/base/256970 Log: Turn off confusing rotation of scroll history. Sponsored by: The FreeBSD Foundation Modified: user/ed/newcons/sys/dev/vt/vt_buf.c Modified: user/ed/newcons/sys/dev/vt/vt_buf.c ============================================================================== --- user/ed/newcons/sys/dev/vt/vt_buf.c Wed Oct 23 14:06:41 2013 (r256969) +++ user/ed/newcons/sys/dev/vt/vt_buf.c Wed Oct 23 14:15:46 2013 (r256970) @@ -54,7 +54,7 @@ static MALLOC_DEFINE(M_VTBUF, "vtbuf", " int vthistory_seek(struct vt_buf *vb, int offset, int whence) { - int roffset; + int top, bottom, roffset; /* No scrolling if not enabled. */ if ((vb->vb_flags & VBF_SCROLL) == 0) { @@ -64,11 +64,15 @@ vthistory_seek(struct vt_buf *vb, int of } return (0); /* No changes */ } + top = (vb->vb_flags & VBF_HISTORY_FULL)? + (vb->vb_curroffset + vb->vb_scr_size.tp_row):vb->vb_history_size; + bottom = vb->vb_curroffset + vb->vb_history_size; + /* * Operate on copy of offset value, since it temporary can be bigger * than amount of rows in buffer. */ - roffset = vb->vb_roffset; + roffset = vb->vb_roffset + vb->vb_history_size; switch (whence) { case VHS_SET: roffset = offset; @@ -82,11 +86,10 @@ vthistory_seek(struct vt_buf *vb, int of break; } - if (roffset < 0) - roffset = 0; - if (roffset >= vb->vb_history_size) - /* Still have screen_height rows. */ - roffset %= VTBUF_MAX_HEIGHT(vb); + roffset = (roffset < top)?top:roffset; + roffset = (roffset > bottom)?bottom:roffset; + + roffset %= vb->vb_history_size; if (vb->vb_roffset != roffset) { vb->vb_roffset = roffset;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310231415.r9NEFkXT003267>