- if y < self.size.y - 1 or x + len(line) < self.size.x:
- stdscr.addstr(y, x, line, curses.color_pair(1))
- else: # workaround to <https://stackoverflow.com/q/7063128>
- cut_i = self.size.x - x - 1
- cut = line[:cut_i]
- last_char = line[cut_i]
- stdscr.addstr(y, self.size.x - 2, last_char, curses.color_pair(1))
- stdscr.insstr(y, self.size.x - 2, ' ')
- stdscr.addstr(y, x, cut, curses.color_pair(1))
+ self.screen.safe_addstr(y, x, line, curses.color_pair(1))