diff options
Diffstat (limited to 'src/editor.py')
| -rw-r--r-- | src/editor.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/editor.py b/src/editor.py index 709278b..b7cf2a9 100644 --- a/src/editor.py +++ b/src/editor.py @@ -446,6 +446,12 @@ class TextArea(): def limit_text(self, text): + ''' + Limit a text to fit the width of the screen + + @param text:str The text + @return :str The text truncated + ''' max_len = self.width if len(text) > max_len: text = text[:max_len - 1] + '…' |
