Method: rich.live_render.LiveRender.position_cursor
Calls: 109, Exceptions: 0, Paths: 2Back
Path 1: 95 calls (0.87)
Control (95)
1def position_cursor(self) -> Control:
2 """Get control codes to move cursor to beginning of live render.
3
4 Returns:
5 Control: A control instance that may be printed.
6 """
7 if self._shape is not None:
8 _, height = self._shape
9 return Control(
10 ControlType.CARRIAGE_RETURN,
11 (ControlType.ERASE_IN_LINE, 2),
12 *(
13 (
14 (ControlType.CURSOR_UP, 1),
15 (ControlType.ERASE_IN_LINE, 2),
16 )
17 * (height - 1)
18 )
19 )
20 return Control()
Path 2: 14 calls (0.13)
Control (14)
1def position_cursor(self) -> Control:
2 """Get control codes to move cursor to beginning of live render.
3
4 Returns:
5 Control: A control instance that may be printed.
6 """
7 if self._shape is not None:
8 _, height = self._shape
9 return Control(
10 ControlType.CARRIAGE_RETURN,
11 (ControlType.ERASE_IN_LINE, 2),
12 *(
13 (
14 (ControlType.CURSOR_UP, 1),
15 (ControlType.ERASE_IN_LINE, 2),
16 )
17 * (height - 1)
18 )
19 )
20 return Control()