def __init__( self, stdscr: 'curses._CursesWindow', filenames: List[Optional[str]], initial_lines: List[int], perf: Perf, ) -> None: self.stdscr = stdscr self.color_manager = ColorManager.make() self.hl_factories = (Syntax.from_screen(stdscr, self.color_manager), ) self.files = [ File(filename, line, self.color_manager, self.hl_factories) for filename, line in zip(filenames, initial_lines) ] self.i = 0 self.history = History() self.perf = perf self.status = Status() self.margin = Margin.from_current_screen() self.cut_buffer: Tuple[str, ...] = () self.cut_selection = False self._buffered_input: Union[int, str, None] = None
def resize(self) -> None: curses.update_lines_cols() self.margin = Margin.from_current_screen() self.file.buf.scroll_screen_if_needed(self.margin) self.draw()