Allow full description if there is no room to shorten #103

Merged
asdf merged 1 commits from fzzyyti/linkulator2:master into master 2021-08-17 10:39:00 +00:00
Contributor

The textwrap.shorten method throws a ValueError if desc_len is less than or equal to 0. This is the case using Termius with my phone at a 37 column width. The exception is caught and the user sees a message saying no thread was found with the typed ID.

Instead of throwing the exception, the description could default to full length if there is not enough room to show the table without wrapping anyway.

I tested this on RTC with a phone and a regular sized terminal emulator.

The textwrap.shorten method throws a ValueError if desc_len is less than or equal to 0. This is the case using Termius with my phone at a 37 column width. The exception is caught and the user sees a message saying no thread was found with the typed ID. Instead of throwing the exception, the description could default to full length if there is not enough room to show the table without wrapping anyway. I tested this on RTC with a phone and a regular sized terminal emulator.
fzzyyti added 1 commit 2021-08-15 08:18:23 +00:00
asdf self-assigned this 2021-08-17 09:59:31 +00:00
Collaborator

hi @fzzyyti,

thanks for the bug report as well as a fix :)

i think i will put this one in as-is, and have applied a fix to the branch where a curses version is being built.

Additionally, this screen should probably not display as many fields in a narrow screen. it should be possible to calculate a point at which a certain field should not be printed, with the minimum of index, description and new marker being printed. I'll raise a new issue for this.

hi @fzzyyti, thanks for the bug report as well as a fix :) i think i will put this one in as-is, and have applied a fix to the branch where a curses version is being built. Additionally, this screen should probably not display as many fields in a narrow screen. it should be possible to calculate a point at which a certain field should not be printed, with the minimum of index, description and new marker being printed. I'll raise a new issue for this.
asdf merged commit 34bd525b82 into master 2021-08-17 10:39:00 +00:00
Sign in to join this conversation.
No description provided.