Fixed bug where folding a comment would crash the page.
This commit is contained in:
@@ -69,8 +69,14 @@ class SubmissionPage(BasePage):
|
||||
self.draw()
|
||||
|
||||
def toggle_comment(self):
|
||||
|
||||
self.content.toggle(self.nav.absolute_index)
|
||||
|
||||
current_index = self.nav.absolute_index
|
||||
self.content.toggle(current_index)
|
||||
if self.nav.inverted:
|
||||
# Reset the page so that the bottom is at the cursor position.
|
||||
# This is a workaround to handle if folding the causes the
|
||||
# cursor index to go out of bounds.
|
||||
self.nav.page_index, self.nav.cursor_index = current_index, 0
|
||||
|
||||
def refresh_content(self):
|
||||
|
||||
@@ -208,4 +214,4 @@ class SubmissionPage(BasePage):
|
||||
text = Symbol.clean('{score} {comments}'.format(**data))
|
||||
win.addnstr(row, 1, text, n_cols, curses.A_BOLD)
|
||||
|
||||
win.border()
|
||||
win.border()
|
||||
|
||||
Reference in New Issue
Block a user