From 2effe70c82039ea1c125797b50f14abfe5d817f7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 18 Sep 2013 11:03:43 +0200 Subject: m doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/editor.py | 6 ++++++ 1 file changed, 6 insertions(+) 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] + '…' -- cgit v1.2.3-70-g09d2