fix error when open subreddit

This commit is contained in:
peterpans01
2015-03-07 22:20:13 +07:00
parent e555d512e7
commit af86a3ad67

View File

@@ -81,7 +81,7 @@ class SubredditPage(BasePage):
n_rows, n_cols = self.stdscr.getmaxyx()
self.stdscr.addstr(n_rows-1, 0, prompt, attr)
self.stdscr.refresh()
window = self.stdscr.derwin(n_rows-1, len(prompt))
window = self.stdscr.derwin(1, n_cols-len(prompt),n_rows-1, len(prompt))
window.attrset(attr)
out = text_input(window)
@@ -132,4 +132,4 @@ class SubredditPage(BasePage):
text = '{author}'.format(**data)
win.addnstr(row, 1, text, n_cols-1, curses.A_BOLD)
text = ' {subreddit}'.format(**data)
win.addnstr(text, n_cols - win.getyx()[1], Color.YELLOW)
win.addnstr(text, n_cols - win.getyx()[1], Color.YELLOW)