MCPcopy Index your code
hub / github.com/python/cpython / _scroll

Method _scroll

Lib/_pyrepl/windows_console.py:281–298  ·  view source on GitHub ↗
(
        self, top: int, bottom: int, left: int | None = None, right: int | None = None
    )

Source from the content-addressed store, hash-verified

279 self.move_cursor(0, y)
280
281 def _scroll(
282 self, top: int, bottom: int, left: int | None = None, right: int | None = None
283 ) -> None:
284 scroll_rect = SMALL_RECT()
285 scroll_rect.Top = SHORT(top)
286 scroll_rect.Bottom = SHORT(bottom)
287 scroll_rect.Left = SHORT(0 if left is None else left)
288 scroll_rect.Right = SHORT(
289 self.getheightwidth()[1] - 1 if right is None else right
290 )
291 destination_origin = _COORD()
292 fill_info = CHAR_INFO()
293 fill_info.UnicodeChar = " "
294
295 if not ScrollConsoleScreenBuffer(
296 OutHandle, scroll_rect, None, destination_origin, fill_info
297 ):
298 raise WinError(get_last_error())
299
300 def _hide_cursor(self):
301 self.__write("\x1b[?25l")

Callers 1

refreshMethod · 0.95

Calls 5

getheightwidthMethod · 0.95
_COORDClass · 0.90
WinErrorFunction · 0.90
CHAR_INFOClass · 0.85
get_last_errorFunction · 0.85

Tested by

no test coverage detected