From owner-svn-src-all@FreeBSD.ORG Mon Dec 23 05:47:28 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35B26DD0; Mon, 23 Dec 2013 05:47:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 21BBD1A8F; Mon, 23 Dec 2013 05:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBN5lRQj017004; Mon, 23 Dec 2013 05:47:27 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBN5lRU8017003; Mon, 23 Dec 2013 05:47:27 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201312230547.rBN5lRU8017003@svn.freebsd.org> From: Ed Schouten Date: Mon, 23 Dec 2013 05:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259761 - head/sys/teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2013 05:47:28 -0000 Author: ed Date: Mon Dec 23 05:47:27 2013 New Revision: 259761 URL: http://svnweb.freebsd.org/changeset/base/259761 Log: Fix linewrapping behaviour for CJK fullwidth characters. Instead of only wrapping when in the 'wrapped state', also force wrapping when the character to be rendered does not fit on the line anymore. Tested by: lwhsu Modified: head/sys/teken/teken_subr.h Modified: head/sys/teken/teken_subr.h ============================================================================== --- head/sys/teken/teken_subr.h Mon Dec 23 04:38:56 2013 (r259760) +++ head/sys/teken/teken_subr.h Mon Dec 23 05:47:27 2013 (r259761) @@ -840,13 +840,18 @@ teken_subr_regular_character(teken_t *t, } t->t_cursor.tp_col = 0; } - } else if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 && - (t->t_stateflags & (TS_WRAPPED|TS_AUTOWRAP)) == - (TS_WRAPPED|TS_AUTOWRAP)) { + } else if (t->t_stateflags & TS_AUTOWRAP && + ((t->t_stateflags & TS_WRAPPED && + t->t_cursor.tp_col + 1 == t->t_winsize.tp_col) || + t->t_cursor.tp_col + width > t->t_winsize.tp_col)) { teken_pos_t tp; - /* Perform line wrapping. */ - + /* + * Perform line wrapping, if: + * - Autowrapping is enabled, and + * - We're in the wrapped state at the last column, or + * - The character to be printed does not fit anymore. + */ if (t->t_cursor.tp_row == t->t_scrollreg.ts_end - 1) { /* Perform scrolling. */ teken_subr_do_scroll(t, 1);