mirror of
https://github.com/wellle/tmux-complete.vim.git
synced 2025-12-21 12:19:32 +01:00
System call should be done in the python process to avoid blocking Vim
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user