diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2013-12-07 00:25:14 +0100 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2013-12-07 01:09:23 +0100 |
commit | df2cf3a95166cb4c01b68718636f4621eaf315f2 (patch) | |
tree | 02bb196b9f8a7f46e72e4510bee7e9edd75a01ce /crawl-ref/source/util/txc | |
parent | e3bebaeb8970e610ae8596d1c82e3d72751950fd (diff) | |
download | crawl-ref-df2cf3a95166cb4c01b68718636f4621eaf315f2.tar.gz crawl-ref-df2cf3a95166cb4c01b68718636f4621eaf315f2.zip |
[txc] Try to not break long words.
Doesn't always work though, so :nowrap is still sometimes necessary.
Diffstat (limited to 'crawl-ref/source/util/txc')
-rwxr-xr-x | crawl-ref/source/util/txc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crawl-ref/source/util/txc b/crawl-ref/source/util/txc index 9de270625c..5dfdda1f79 100755 --- a/crawl-ref/source/util/txc +++ b/crawl-ref/source/util/txc @@ -1239,13 +1239,18 @@ class Menu(OrderedDict): self.build_main_menu() self.show_menu() -wrapper = TextWrapper(width = 79, break_on_hyphens = False) +wrapper_args = { + 'width' : 79, + 'break_on_hyphens' : False, + 'break_long_words' : False} + +wrapper = TextWrapper(**wrapper_args) # Use hardcoded whitespaces instead of \s because the latter matches # non-breaking spaces (see textwrap.py:30). wrapper.wordsep_simple_re_uni = re.compile(r'([%s]+)' % _whitespace) -FWwrapper = FullWidthTextWrapper(width = 79, break_on_hyphens = False) -FW_NS_wrapper = FullWidthTextWrapper(width = 79, break_on_hyphens = False, - no_space = True) +FWwrapper = FullWidthTextWrapper(**wrapper_args) +wrapper_args['no_space'] = True +FW_NS_wrapper = FullWidthTextWrapper(**wrapper_args) # We initialize the resource index early because we might need it if we have to # initialize the transifex configuration. |