witchie/toot
Denis Laxalde 0bf4b2a21a
Fix left column padding in timeline with wide characters
When the left column contains wide characters (which occupy more than
one cell when printed to screen), padding to 30-characters with
"{:30}".format() does not work well. This happens for instance when the
display name contains unicode characters such as emojis.

We fix this by introducing a pad() function in utils module which uses
the wcwidth library (https://pypi.org/project/wcwidth/) to compute the
length of the text for the column. trunc() function is also adjusted to
optionally compute the length of the text to be truncated since, when
called from pad(), we now pre-compute this value.

We update test for timeline rendering so that the display name now
includes an emoji. (Without the fix, the test would not pass as left
column would be misaligned.)
2019-02-14 14:21:53 +01:00
..
ui Update for the curses ui help menu (#78) 2018-12-30 22:34:15 +01:00
__init__.py Bump version 2019-01-02 12:51:49 +01:00
api.py Mark function as private 2019-02-13 14:19:27 +01:00
auth.py Enable fetching instance info over http 2018-12-30 09:53:12 +01:00
commands.py Make toot timeline continuable by pressing Enter 2019-02-13 14:19:00 +01:00
config.py Create config folder if it does not exist 2018-01-15 23:14:20 +01:00
config_legacy.py More robust parsing of legacy config 2018-01-14 13:04:04 +01:00
console.py Make toot timeline continuable by pressing Enter 2019-02-13 14:19:00 +01:00
exceptions.py Extract exceptions 2017-12-30 13:32:52 +01:00
http.py Apply requests environment settings 2018-12-30 10:38:40 +01:00
logging.py Enable logging to a file 2018-01-14 15:34:41 +01:00
output.py Fix left column padding in timeline with wide characters 2019-02-14 14:21:53 +01:00
utils.py Fix left column padding in timeline with wide characters 2019-02-14 14:21:53 +01:00