Skip to content

Commit

Permalink
typing fix
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Oct 1, 2024
1 parent ff52f68 commit 0c77fb7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rich/_win32_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
"""

import ctypes
import sys
from typing import Any
Expand Down Expand Up @@ -380,7 +381,7 @@ def cursor_position(self) -> WindowsCoordinates:
WindowsCoordinates: The current cursor position.
"""
coord: COORD = GetConsoleScreenBufferInfo(self._handle).dwCursorPosition
return WindowsCoordinates(row=cast(int, coord.Y), col=cast(int, coord.X))
return WindowsCoordinates(row=coord.Y, col=coord.X)

@property
def screen_size(self) -> WindowsCoordinates:
Expand All @@ -390,9 +391,7 @@ def screen_size(self) -> WindowsCoordinates:
WindowsCoordinates: The width and height of the screen as WindowsCoordinates.
"""
screen_size: COORD = GetConsoleScreenBufferInfo(self._handle).dwSize
return WindowsCoordinates(
row=cast(int, screen_size.Y), col=cast(int, screen_size.X)
)
return WindowsCoordinates(row=screen_size.Y, col=screen_size.X)

def write_text(self, text: str) -> None:
"""Write text directly to the terminal without any modification of styles
Expand Down

0 comments on commit 0c77fb7

Please sign in to comment.