From owner-svn-src-head@FreeBSD.ORG Wed Nov 11 08:11:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AA70106566B; Wed, 11 Nov 2009 08:11:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49F638FC08; Wed, 11 Nov 2009 08:11:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAB8BMb7086883; Wed, 11 Nov 2009 08:11:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAB8BMxv086882; Wed, 11 Nov 2009 08:11:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200911110811.nAB8BMxv086882@svn.freebsd.org> From: Ed Schouten Date: Wed, 11 Nov 2009 08:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199170 - head/sys/teken X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Nov 2009 08:11:22 -0000 Author: ed Date: Wed Nov 11 08:11:21 2009 New Revision: 199170 URL: http://svn.freebsd.org/changeset/base/199170 Log: Always home the cursor when changing the scrolling region. I thought this only had to be done when in origin mode, to ensure that the cursor is not placed outside the origin, but it seems this is also done when not in origin mode. This fixes some artifacts when pressing ^L while running irssi in tmux. (Almost) nobody noticed this, because cons25 doesn't have scrolling regions. Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Wed Nov 11 03:17:51 2009 (r199169) +++ head/sys/teken/teken_subr.h Wed Nov 11 08:11:21 2009 (r199170) @@ -1237,16 +1237,17 @@ teken_subr_set_top_and_bottom_margins(te bottom = t->t_winsize.tp_row; } + /* Apply scrolling region. */ t->t_scrollreg.ts_begin = top; t->t_scrollreg.ts_end = bottom; - if (t->t_stateflags & TS_ORIGIN) { - /* XXX: home cursor? */ + if (t->t_stateflags & TS_ORIGIN) t->t_originreg = t->t_scrollreg; - t->t_cursor.tp_row = t->t_originreg.ts_begin; - t->t_cursor.tp_col = 0; - t->t_stateflags &= ~TS_WRAPPED; - teken_funcs_cursor(t); - } + + /* Home cursor to the top left of the scrolling region. */ + t->t_cursor.tp_row = t->t_originreg.ts_begin; + t->t_cursor.tp_col = 0; + t->t_stateflags &= ~TS_WRAPPED; + teken_funcs_cursor(t); } static void