From 4d94c4ce5da3741817fe2e81923fa63d4d531190 Mon Sep 17 00:00:00 2001 From: moculus Date: Mon, 28 Apr 2008 06:46:14 +0000 Subject: [PATCH] fixed possble giant error bug --HG-- branch : pmacs2 --- application.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application.py b/application.py index 3160040..6f0de4e 100755 --- a/application.py +++ b/application.py @@ -27,6 +27,8 @@ def run_app(stdscr, buffers, jump_to_line=None, init_mode=None): a = Application(stdscr, buffers, jump_to_line, init_mode) a.run() +MAX_ERROR_DISPLAY = 128 + KILL_RING_LIMIT = 128 WORD_LETTERS = list(string.letters + string.digits) ERROR_TIMEOUT = -1 @@ -779,7 +781,10 @@ class Application(object): def get_minibuffer_lines(self): lines, lines2 = [], [] if self.error_string: - s = self.error_string + if len(self.error_string) < MAX_ERROR_DISPLAY: + s = self.error_string + else: + s = self.error_string[:MAX_ERROR_DISPLAY] + '...' elif self.mini_buffer_is_open(): s = self.mini_prompt + self.mini_buffer.lines[0] lines2 = self.mini_buffer.lines[1:]