(window, path, view_id=None, ignore_existing=False, single_pane=False, goto='', other_group='')
Determines the correct view to use, creating one if necessary, and prepares it.
Determines the correct view to use, creating one if necessary, and prepares it.
Determines the correct view to use creating one if necessary and prepares it .
def show(window, path, view_id=None, ignore_existing=False, single_pane=False, goto='', other_group=''):
    """
    Determines the correct view to use, creating one if necessary, and prepares it.
    """
    if other_group:
        prev_focus = window.active_view()
        # simulate 'toggle sidebar':
        if prev_focus and 'dired' in prev_focus.scope_name(0):
            window.run_command('close_file')
            return

    if not path.endswith(os.sep):
        path += os.sep

    view, reset_sels = set_view(view_id, window, ignore_existing, path, single_pane)

    nag, group = set_active_group(window, view, other_group)

    if other_group and prev_focus:
        window.focus_view(prev_focus)

    if path == os.sep:
        view_name = os.sep
    else:
        view_name = basename(path.rstrip(os.sep))

    if ST3:
        name = u"𝌆 {0}".format(view_name)
    else:
        name = u"■ {0}".format(view_name)

    view.set_name(name)
    view.settings().set('dired_path', path)
    view.settings().set('dired_rename_mode', False)

    # forcibly shoot on_activated, because when view was created it didnot have any settings
    window.show_quick_panel(['a', 'b'], None)
    view.run_command('dired_refresh', {'goto': goto, 'reset_sels': reset_sels})
    window.run_command('hide_overlay')
    window.focus_view(view)
def show ( window , path , view_id = None , ignore_existing = False , single_pane = False , goto = '' , other_group = '' ) : if other_group : prev_focus = window . active_view ( ) # simulate 'toggle sidebar': if prev_focus and 'dired' in prev_focus . scope_name ( 0 ) : window . run_command ( 'close_file' ) return if not path . endswith ( os . sep ) : path += os . sep view , reset_sels = set_view ( view_id , window , ignore_existing , path , single_pane ) nag , group = set_active_group ( window , view , other_group ) if other_group and prev_focus : window . focus_view ( prev_focus ) if path == os . sep : view_name = os . sep else : view_name = basename ( path . rstrip ( os . sep ) ) if ST3 : name = u"𝌆 {0}".fo r mat(vi e w_name) else : name = u"■ {0}".f o rmat(v i ew_name) view . set_name ( name ) view . settings ( ) . set ( 'dired_path' , path ) view . settings ( ) . set ( 'dired_rename_mode' , False ) # forcibly shoot on_activated, because when view was created it didnot have any settings window . show_quick_panel ( [ 'a' , 'b' ] , None ) view . run_command ( 'dired_refresh' , { 'goto' : goto , 'reset_sels' : reset_sels } ) window . run_command ( 'hide_overlay' ) window . focus_view ( view )