예제 #1
0
def _choose_action(denite: Default, params: Params) -> typing.Any:
    candidates = denite._get_selected_candidates()
    if not candidates or not denite._denite:
        return

    action_names = denite._denite.get_action_names(denite._context, candidates)
    denite._vim.vars['denite#_actions'] = action_names
    clear_cmdline(denite._vim)
    action = input(denite._vim, denite._context, 'Action: ', '',
                   'customlist,denite#helper#complete_actions')
    if action == '':
        return
    return denite.do_action(action, is_manual=True)
예제 #2
0
파일: map.py 프로젝트: matsui54/denite.nvim
def _choose_action(denite: Default, params: Params) -> typing.Any:
    candidates = denite._get_selected_candidates()
    if not candidates or not denite._denite:
        return

    action_names = denite._denite.get_action_names(denite._context, candidates)
    context = copy.copy(denite._context)
    context['buffer_name'] = denite._context['buffer_name'] + '@'

    # Quit current denite
    denite.quit()

    # New denite for choose action
    denite._vim.call(
        'denite#start',
        [{
            'name': '_action',
            'args': [action_names, denite._context['buffer_name'], candidates],
        }], context)