From 4c1ef89f64fd6ecb2e3c34d29c8217a3f7c1083c Mon Sep 17 00:00:00 2001 From: Silas Kraume Date: Sun, 10 Sep 2023 00:24:20 +0200 Subject: [PATCH] fix indexerror --- cat_win/util/editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cat_win/util/editor.py b/cat_win/util/editor.py index edc0cffe..d8366c7d 100644 --- a/cat_win/util/editor.py +++ b/cat_win/util/editor.py @@ -477,6 +477,8 @@ def _render_scr(self) -> None: brow = row + self.wpos.row for col in range(max_x): bcol = col + self.wpos.col + if brow >= len(self.window_content) or bcol >= len(self.window_content[brow]): + break try: if self.window_content[brow][bcol] == '\t': self.curse_window.addch(row, col, '>', self._get_color(4)) @@ -487,7 +489,7 @@ def _render_scr(self) -> None: self._get_color(3)) else: self.curse_window.addch(row, col, self.window_content[brow][bcol]) - except (IndexError, curses.error): + except curses.error: break self.curse_window.clrtoeol() try: