示例#1
0
 def action_execute(self, context):
     target = context['targets'][0]
     command = target['source__word']
     util.clear_cmdline(self.vim)
     if target['source__type'] == 'search':
         self.vim.call('denite#extra#search', command)
     else:
         self.vim.call('denite#util#execute_command', command)
示例#2
0
 def action_execute(self, context):
     target = context['targets'][0]
     command = target['source__command']
     args = target['source__args']
     if args:
         util.clear_cmdline(self.vim)
         self.vim.call('denite#extra#feedkeys', ':%s' % command)
     else:
         self.vim.call('denite#util#execute_command', command, False)
示例#3
0
 def action_execute(self, context):
     target = context['targets'][0]
     command = target['source__command']
     args = target['source__args']
     if args:
         util.clear_cmdline(self.vim)
         self.vim.call('denite#extra#feedkeys', ':%s' % command)
     else:
         self.vim.call('denite#util#execute_command', command, False)
示例#4
0
 def action_feedkeys(self, context):
     target = context['targets'][0]
     command = target['source__word']
     util.clear_cmdline(self.vim)
     if target['source__type'] == 'search':
         keys = '/%s' % command
     elif target['source__type'] == 'cmd':
         keys = ':%s' % command
     else:
         keys = command
     self.vim.call('denite#extra#feedkeys', keys)
示例#5
0
    def choose_action(self):
        candidates = self.get_selected_candidates()
        if not candidates:
            return

        self._vim.vars['denite#_actions'] = self._denite.get_action_names(
            self._context, candidates)
        clear_cmdline(self._vim)
        action = self._vim.call('input', 'Action: ', '',
                                'customlist,denite#helper#complete_actions')
        if action == '':
            return
        return self.do_action(action)
示例#6
0
    def choose_action(self):
        candidates = self.get_selected_candidates()
        if not candidates:
            return

        self._vim.vars['denite#_actions'] = self._denite.get_action_names(
            self._context, candidates)
        clear_cmdline(self._vim)
        action = self._vim.call('input', 'Action: ', '',
                                'customlist,denite#helper#complete_actions')
        if action == '':
            return
        return self.do_action(action)
示例#7
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)
示例#8
0
    def action_execute(self, context):
        target = context['targets'][0]
        command = target['source__word']
        util.clear_cmdline(self.vim)
        if target['source__type'] == 'search':
            self.vim.call('denite#extra#search', command)
        else:
            if target['source__type'] == 'cmd':
                self.vim.call('histadd', target['source__type'], command)

            self._execute(context,
                command,
                target.get('action__is_pause', False))