From a17560cc01586a48d0b0aaff953be012c685f15d Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Tue, 9 Jun 2015 23:57:26 +0200 Subject: [PATCH] Better handling of multi buffer completion CHG: Recognise done.txt format for project and context completion ADD: Show buffer name in which the project/context exists --- ftplugin/todo.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ftplugin/todo.vim b/ftplugin/todo.vim index ab09a9f..9b1822e 100644 --- a/ftplugin/todo.vim +++ b/ftplugin/todo.vim @@ -251,7 +251,7 @@ fun! TodoComplete(findstart, base) for bufnr in range(1,bufnr('$')) let lines=getbufline(bufnr,1,"$") for line in lines - if line =~ "([a-Z]).* ".a:base + if line =~ "[x\s0-9\-]*([a-Z]).* ".a:base let item={} let item.word=substitute(line,'.*\('.a:base.'\S*\).*','\1',"") if a:base =~ '+' @@ -265,6 +265,7 @@ fun! TodoComplete(findstart, base) endfor let item.info="Projects: ".join(uniq(l:pr), " ") endif + let item.info.="\nBuffer: ".bufname(bufnr) call add(res,item) endif endfor