Commit Graph

8 Commits

Author SHA1 Message Date
Matt Mackall
6435383b32 help: generate command help into a single RST string for formatting 2011-10-07 17:08:24 -05:00
Matt Mackall
58c81fa35e help: unify the two -v notes for command help 2011-10-07 16:36:54 -05:00
Matt Mackall
4204f3ffa5 help: use RST to format option lists 2011-09-21 13:00:48 -05:00
FUJIWARA Katsunori
5b5a083f16 i18n: calculate terminal columns by width information of each characters
neither number of 'bytes' in any encoding nor 'characters' is
appropriate to calculate terminal columns for specified string.

this patch modifies MBTextWrapper for:

  - overriding '_wrap_chunks()' to make it use not built-in 'len()'
    but 'encoding.colwidth()' for columns of string

  - fixing '_cutdown()' to make it use 'encoding.colwidth()' instead
    of local, similar but incorrect implementation

this patch also modifies 'encoding.py':

  - dividing 'colwith()' into 2 pieces: one for calculation columns of
    specified UNICODE string, and another for rest part of original
    one. the former is used from MBTextWrapper in 'util.py'.

  - preventing 'colwidth()' from evaluating HGENCODINGAMBIGUOUS
    configuration per each invocation: 'unicodedata.east_asian_width'
    checking is kept intact for reducing startup cost.
2011-08-27 04:56:12 +09:00
Mads Kiilerich
ec483cfecb util: wrap lines with multi-byte characters correctly (issue2943)
This re-introduces the unicode conversion what was lost in e5976ee55f4b 5 years
ago and had the comment:
  To avoid corrupting multi-byte characters in line, we must wrap
  a Unicode string instead of a bytestring.
2011-08-06 23:52:20 +02:00
Mads Kiilerich
82954d10d1 tests: use (esc) markup for string-escape
This makes test output less ambiguous.

Failing test output will be escaped and marked up if necessary. A Python
string-escape compatible encoding is used, but not everything is encoded -
especially not \n and \t and '.
2010-11-08 01:35:41 +01:00
Yuya Nishihara
42e1ec7a53 tests: asciify output of test-encoding-align.t 2010-10-02 22:59:29 +09:00
Matt Mackall
589dbb9433 tests: unify test-encoding-align 2010-09-26 13:41:32 -05:00