Skip to content

Commit

Permalink
Merge pull request #1810 from timbrel/update-sublime-types
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste authored Nov 19, 2023
2 parents d97f0fc + bc70524 commit 6e3b82e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
3 changes: 3 additions & 0 deletions common/util/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ def refresh_gitsavvy_interfaces(

for group in range(window.num_groups()):
view = window.active_view_in_group(group)
if view is None:
continue

if view.settings().get("git_savvy.interface") is not None:
view.run_command("gs_interface_refresh")

Expand Down
34 changes: 17 additions & 17 deletions stubs/sublime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ BufferId = NewType('BufferId', int)
ViewId = NewType('ViewId', int)
_T = TypeVar('_T')

# Point = NewType('Point', int)
# Pixel = NewType('Pixel', float)
# Vector = NewType('Vector', Tuple[float, float])
Point = int
Pixel = float
Vector = Tuple[Pixel, Pixel]
DIP = float

class Window:
window_id = ... # type: WindowId
Expand Down Expand Up @@ -154,8 +152,8 @@ class Window:
def set_view_index(self, view: View, group: int, idx: int) -> None: ...
def sheets(self) -> List[Sheet]: ...
def views(self) -> List[View]: ...
def active_sheet_in_group(self, group: int) -> Sheet: ...
def active_view_in_group(self, group: int) -> View: ...
def active_sheet_in_group(self, group: int) -> Optional[Sheet]: ...
def active_view_in_group(self, group: int) -> Optional[View]: ...
def sheets_in_group(self, group: int) -> List[Sheet]: ...
def views_in_group(self, group: int) -> List[View]: ...
def transient_sheet_in_group(self, group: int) -> Optional[View]: ...
Expand Down Expand Up @@ -211,24 +209,26 @@ class Edit:
def __init__(self, token: Any) -> None: ...

class Region:
a = ... # type: Point
b = ... # type: Point
xpos = ... # type: int
def __init__(
self, a: int, b: Optional[int] = ..., xpos: int = ...
) -> None: ...
a: Point
b: Point
xpos: DIP
def __init__(self, a: Point, b: Optional[Point] = None, xpos: DIP = -1) -> None: ...
def __iter__(self) -> Iterator[Point]: ...
def __str__(self) -> str: ...
def __repr__(self) -> str: ...
def __len__(self) -> int: ...
def __eq__(self, rhs: Any) -> bool: ...
def __eq__(self, rhs: object) -> bool: ...
def __lt__(self, rhs: Region) -> bool: ...
def __contains__(self, x: Union[int, Region]) -> bool: ...
def __contains__(self, v: Union[Point, Region]) -> bool: ...
def to_tuple(self) -> tuple[Point, Point]: ...
def empty(self) -> bool: ...
def begin(self) -> Point: ...
def end(self) -> Point: ...
def size(self) -> int: ...
def contains(self, x: Union[int, Region]) -> bool: ...
def cover(self, rhs: Region) -> Region: ...
def intersection(self, rhs: Region) -> Region: ...
def intersects(self, rhs: Region) -> bool: ...
def contains(self, x: Union[Point, Region]) -> bool: ...
def cover(self, region: Region) -> Region: ...
def intersection(self, region: Region) -> Region: ...
def intersects(self, region: Region) -> bool: ...

class Selection(Sized):
view_id = ... # type: ViewId
Expand Down

0 comments on commit 6e3b82e

Please sign in to comment.