def run(self):
        """Define and enter text viewer loop."""
        ### blit a semitransparent surface to in the canvas
        ### to increase constrast between the dialog and
        ### whatever is behind it

        blit_on_screen(UNHIGHLIGHT_SURF_MAP[SCREEN_RECT.size], (0, 0))

        ### loop until self.running is changed

        self.running = True

        while self.running:

            ### perform various checkups for this frame;
            ###
            ### stuff like maintaing a constant framerate and more
            SERVICES_NS.frame_checkups()

            self.handle_input()

            self.draw()

        ### blit semitransparent obj

        ## over self.rect

        blit_on_screen(
            UNHIGHLIGHT_SURF_MAP[self.rect.size],
            self.rect.topleft,
        )

        ## over lineno panel if line numbers were shown

        if self.draw_lines == self.draw_lines_and_lineno:

            panel_rect = self.lineno_panel.rect

            blit_on_screen(
                UNHIGHLIGHT_SURF_MAP[panel_rect.size],
                panel_rect.topleft,
            )

        ### free memory from objects you won't use anymore
        self.free_up_memory()
Define and enter text viewer loop.
nodezator/textman/viewer/op.py