Fix truncated messages being one character too long in topic list

This commit is contained in:
Eric Budd 2018-05-11 16:26:42 -04:00
parent d4c8f81510
commit da11e4434d
2 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@
* Add column headers for topics
* Mark unread topics/topics with unread replies in topics list
* ~Move display headers into frame line~
* ~Fix truncated message headers being one character too long in topic list~
# Bugs:
* Is `Time.now.utc.iso8601` working as expected?

View File

@ -357,7 +357,7 @@ class Message
stub = message.split("\n").first
return stub.colorize if stub.decolorize.length <= length
# colorize the stub, then decolorize to strip out any partial tags
stub.colorize.slice(0, length - 6).decolorize + '...'
stub.colorize.slice(0, length - 5 - Display.topic_index_width).decolorize + '...'
end
def latest_topic_timestamp