Date: Mon, 4 Feb 2002 20:26:37 +0800 (CST) From: mhsin@mhsin.org To: FreeBSD-gnats-submit@freebsd.org Subject: ports/34610: chinese/mutt causes some strange line wrapping with Big5 string. Message-ID: <200202041226.g14CQb066081@mhsin.org>
next in thread | raw e-mail | index | archive | help
>Number: 34610 >Category: ports >Synopsis: chinese/mutt causes some strange line wrapping with Big5 string. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 04 04:30:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: Michael Hsin >Release: FreeBSD 4.3-RELEASE i386 >Organization: >Environment: System: FreeBSD mhsin.org 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Sat Jun 9 19:54:25 CST 2001 root@mhsin.org:/usr/src/sys/compile/mhsin i386 >Description: chinese/mutt's builtin pager decides wrapping position according to space only, but we used to split a long line at spaces AND next to Big5 characters. >How-To-Repeat: Send a message (to yourself) with a line like this: B5 B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 ^ right margin mutt's pager will display: B5 +B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5B5 But we like this more: B5 B5B5B5B5B5B5B5B5B5B5B5B5B5B5 +B5B5 >Fix: --- mutt-1.3.27/pager.c.orig Mon Feb 4 19:13:03 2002 +++ mutt-1.3.27/pager.c Mon Feb 4 19:14:33 2002 @@ -1028,7 +1028,7 @@ { int space = -1; /* index of the last space or TAB */ int col = option (OPTMARKERS) ? (*lineInfo)[n].continuation : 0; - int ch, vch, k, last_special = -1, special = 0, t; + int ch, vch, k, last_special = -1, special = 0, t = 0, old_t = 0; wchar_t wc; mbstate_t mbstate; @@ -1123,7 +1123,10 @@ { if (wc == ' ') space = ch; + old_t = t; t = wcwidth (wc); + if(t > 1 || old_t > 1) + space = ch; if (col + t > wrap_cols) break; col += t; @@ -1340,6 +1343,7 @@ { buf_ptr = buf + ch; /* skip trailing blanks */ + ch --; while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r')) ch--; cnt = ch + 1; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202041226.g14CQb066081>