System call should be done in the python process to avoid blocking Vim

This commit is contained in:
Thales Mello
2016-10-26 01:14:19 -02:00
parent b6fe12c603
commit c0e1f2b560
2 changed files with 15 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
from .base import Base
import deoplete.util
from subprocess import check_output
class Source(Base):
def __init__(self, vim):
@@ -12,5 +13,6 @@ class Source(Base):
self.rank = 4
def gather_candidates(self, context):
return [{ 'word': x } for x in
self.vim.call('tmuxcomplete#gather_candidates')]
command = self.vim.call('tmuxcomplete#getcommand', '', 'words')
words = check_output(['sh', '-c', command]).decode('utf-8').splitlines()
return [{ 'word': x } for x in words]