From 7c7ec3736f2c21699a340e662e83c0e3cfc8b3af Mon Sep 17 00:00:00 2001 From: Nicholas Matlaga Date: Thu, 31 Aug 2017 16:02:20 -0400 Subject: [PATCH] Fixed EvCell behaviour mentioned in #1410 --- evennia/utils/evtable.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/evennia/utils/evtable.py b/evennia/utils/evtable.py index d7af6b46ca..70abe2439c 100644 --- a/evennia/utils/evtable.py +++ b/evennia/utils/evtable.py @@ -525,10 +525,14 @@ class EvCell(object): # don't allow too high cells excess = len(adjusted_data) - self.height if excess > 0: - # too many lines. Crop and mark last line with ... + # too many lines. Crop and mark last line with crop_string + crop_string = self.crop_string adjusted_data = adjusted_data[:-excess] - if len(adjusted_data[-1]) > 3: - adjusted_data[-1] = adjusted_data[-1][:-2] + ".." + crop_string_length = len(crop_string) + if len(adjusted_data[-1]) > crop_string_length: + adjusted_data[-1] = adjusted_data[-1][:-crop_string_length] + crop_string + else: + adjusted_data[-1] += crop_string elif excess < 0: # too few lines. Fill to height. adjusted_data.extend(["" for _ in range(excess)])