Skip to content

Instantly share code, notes, and snippets.

@copy
Created January 15, 2018 18:42
Show Gist options
  • Save copy/0ada90677b950de3c2273b874a3265ef to your computer and use it in GitHub Desktop.
Save copy/0ada90677b950de3c2273b874a3265ef to your computer and use it in GitHub Desktop.
from .base import Base
import deoplete.util
import re
import time
class Source(Base):
def __init__(self, vim):
Base.__init__(self, vim)
self.name = 'test'
self.input_pattern = r'.*'
self.get_complete_position_re = re.compile(r"\w*$")
def get_complete_position(self, context):
m = re.search(r"\w*$", context["input"])
return m.start() if m else None
def gather_candidates(self, context):
time.sleep(0.1)
return [
{ "word": "True" },
{ "word": "False" },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment