Skip to content

Commit

Permalink
fix indexerror
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Sep 9, 2023
1 parent f059dd3 commit 4c1ef89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cat_win/util/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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:
Expand Down

0 comments on commit 4c1ef89

Please sign in to comment.