Complete on buffer instead of reading file

This commit is contained in:
David Beniamine
2015-06-09 19:23:04 +02:00
parent 3702e6097c
commit c56632eeaa

View File

@@ -248,8 +248,8 @@ fun! TodoComplete(findstart, base)
endwhile
return start
else
let res = []
let file = readfile(expand("%:p"))
let res = []
let lines=getline(1,"$")
for line in lines
if line =~ " ".a:base
let item={}
@@ -257,7 +257,7 @@ fun! TodoComplete(findstart, base)
if a:base =~ '+'
let item.info="Context: ".substitute(line,'.*\s\(@\S\S*\).*','\1',"")
elseif a:base =~ '@'
let l:pr=[]
let l:pr=[]
for line2 in lines
if line2 =~ l:item.word
call add(l:pr,substitute(line2,'.*\s\(+\S\S*\).*','\1',""))