예제 #1
0
파일: core.py 프로젝트: rwdxll/pyunite
def make_buffer_name(state):
    return '{}{} pyunite:{} ({})'.format(
        '' if state['replace'] else '[NR] ',
        state['scope'][:3].upper(),
        str(uniqueid())[:7],
        len(list(aggregate_candidates(state))),
    )
예제 #2
0
파일: core.py 프로젝트: rwdxll/pyunite
def start_unite(state):
    validate_state(state)
    state['uid'] = str(uniqueid())
    state['tabpage_from'] = vim.current.tabpage
    state['window_from'] = vim.current.window
    state['container'] = {
        'global': vim,
        'tabpage': vim.current.tabpage,
        'window': vim.current.window
    }[state['scope']]
    old_state = buffer_logic(state)
    if state['close_on_empty'] and len(list(aggregate_candidates(state))) == 0:
        return
    saved = vim.current.window
    window_logic(state, old_state)
    set_buffer_syntax(state)
    if not state['focus_on_open']:
        change_window(saved, autocmd=True)
    variables.states.append(state)