Skip to content

Commit

Permalink
Use visible_views in log_graph
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Nov 27, 2024
1 parent 816886c commit 60486be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
10 changes: 3 additions & 7 deletions core/commands/log_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
join_regions,
line_distance,
replace_view_content,
show_region
show_region,
visible_views
)
from ..ui_mixins.input_panel import show_single_line_input_panel
from ..ui_mixins.quick_panel import show_branch_panel
Expand Down Expand Up @@ -716,12 +717,7 @@ def on_status_update(repo_path, state):
def on_status_update_(repo_path, repo_is_dirty):
# type: (str, Optional[bool]) -> None
global drawn_graph_statuses, head_commit_seen
visible_views = filter_(
window.active_view_in_group(group)
for window in sublime.windows()
for group in range(window.num_groups())
)
for view in visible_views:
for view in visible_views():
if not head_commit_seen.get(view):
# `gs_log_graph_refresh` is running and has not yet processed HEAD,
# no need to start all over again.
Expand Down
8 changes: 4 additions & 4 deletions core/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ def other_visible_views(view: sublime.View) -> Iterator[sublime.View]:
yield view_


def visible_views(window: sublime.Window) -> Iterator[sublime.View]:
num_groups = window.num_groups()
def visible_views(window: sublime.Window = None) -> Iterator[sublime.View]:
yield from (
sheets_view
for group_id in range(num_groups)
for sheet in window.selected_sheets_in_group(group_id)
for window_ in ([window] if window else sublime.windows())
for group_id in range(window_.num_groups())
for sheet in window_.selected_sheets_in_group(group_id)
if (sheets_view := sheet.view())
)

Expand Down

0 comments on commit 60486be

Please sign in to comment.