Exemplo n.º 1
0
def get_active_views(window: sublime.Window,
                     current_buffer_only: bool) -> List[sublime.View]:
    """Returns all currently visible views"""

    if current_buffer_only:
        group_indexes = [window.active_group()]
    else:
        group_indexes = list(range(window.num_groups()))

    return [window.active_view_in_group(idx)
            for idx in group_indexes]  # type: ignore
Exemplo n.º 2
0
def active_repl_view(window: Window) -> Union[View, None]:
    for group in range(window.num_groups() + 1):
        if (view := window.active_view_in_group(group)) and get_dialect(view):
            return view