Using self.panel.hide() without calling
curses.panel.update_panels() before next refresh can really mess
stuff up. As far as I can tell, this was the real cause of #100.
This changes that call to the Modal's hide method instead, which
will keep this sort of issue from coming up again (hopefully)
Use a callback function to allow items farther up in the stack
to have their own resize logic. This also requires a slight
change to the main TimelineApp to stay DRY
In my testing, not all terminal emulators have the same ctrl+enter
key accelerator for the ascii record seperator, so mention EOT
instead but still leave it in for those that might like it better.
+ Only do a full draw on init, and just refresh on updates / show
+ Better differenciate "No content" vs "quit"
+ Reset the cursor position when content is cleared
Ctrl+Enter (or the standard ^D / EOT) to confirm, Escape to quit.
Since we're asking for a raw escape, we also need to tweak the
curses escape detection timeout a little, otherwise the user would
have to wait a whole second for the keystroke to register
The actual curses provided textbox has issuses with adding
newlines to the toot body when the text wraps to fit,
so I've implimented a basic textbox using draw_lines and an
internal text body (rather than relying on the curses window
contents.
The list of notifications is diplayed with each item enclosed within an
horizontal line as for timeline. When a status is involved (when
notification type is "reblog" or "favourite"), we also display the full
status.
Closes#81.
When parsing "replies_count" from status data, we allow the field to be
absent as it got added in version 2.5.0 (in constrast with other ones,
added in 0.1.0) as there might be servers with that version around.
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.)