|
|
@@ -3,8 +3,6 @@ |
|
|
|
import vim |
|
|
|
import subprocess |
|
|
|
from ncm2 import Ncm2Source, getLogger |
|
|
|
import re |
|
|
|
from copy import deepcopy |
|
|
|
|
|
|
|
logger = getLogger(__name__) |
|
|
|
|
|
|
@@ -12,18 +10,15 @@ logger = getLogger(__name__) |
|
|
|
class Source(Ncm2Source): |
|
|
|
|
|
|
|
def on_warmup(self, ctx): |
|
|
|
shell_command = 'khard email --parsable | cut -f 1,2' |
|
|
|
self.dictionary = subprocess.run(shell_command, shell = True, capture_output = True).stdout.decode('utf8').split('\n') |
|
|
|
bufnr = ctx['bufnr'] |
|
|
|
shell_cmd = "khard email --parsable | cut -f 1,2 | sed -r 's/(.*)\t(.*)/\\2 <\\1>/'" |
|
|
|
self.matches = subprocess.run(shell_cmd, shell = True, capture_output = True).stdout.decode('utf8').split('\n') |
|
|
|
|
|
|
|
def on_complete(self, ctx): |
|
|
|
base = ctx['base'] |
|
|
|
# matcher = self.matcher_get(ctx) |
|
|
|
# matches = [] |
|
|
|
|
|
|
|
|
|
|
|
self.complete(ctx, ctx['startccol'], self.dictionary) |
|
|
|
self.complete(ctx, ctx['startccol'], self.matches) |
|
|
|
|
|
|
|
|
|
|
|
source = Source(vim) |
|
|
|
|
|
|
|
on_warmup = source.on_warmup |
|
|
|
on_complete = source.on_complete |