From 3bde2fabd196205a863544f1265128b7f5938ecd Mon Sep 17 00:00:00 2001 From: xinleibird Date: Sat, 22 Mar 2014 14:41:48 +0800 Subject: [PATCH 1/2] filter() result error --- autoload/airline/extensions/eclim.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/eclim.vim b/autoload/airline/extensions/eclim.vim index 8a80813..baf1f7b 100644 --- a/autoload/airline/extensions/eclim.vim +++ b/autoload/airline/extensions/eclim.vim @@ -20,7 +20,8 @@ function! airline#extensions#eclim#get_warnings() if !empty(eclimList) " Remove any non-eclim signs (see eclim#display#signs#Update) - call filter(eclimList, "v:val.name =~ '^\(qf_\)\?\(error\|info\|warning\)$'") + " :help filter() ---- `the result **is zero** remove the item from the |List| or |Dictionary|.` + call filter(eclimList, "v:val.name != '^\(qf_\)\?\(error\|info\|warning\)$'") if !empty(eclimList) let errorsLine = eclimList[0]['line'] From 3c66f13b9a373943e608b6fd7c8f5e364825533b Mon Sep 17 00:00:00 2001 From: xinleibird Date: Sat, 22 Mar 2014 16:16:27 +0800 Subject: [PATCH 2/2] My fault, it's a transferred error, add a '\' that' works fine. --- autoload/airline/extensions/eclim.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoload/airline/extensions/eclim.vim b/autoload/airline/extensions/eclim.vim index baf1f7b..18cbae5 100644 --- a/autoload/airline/extensions/eclim.vim +++ b/autoload/airline/extensions/eclim.vim @@ -20,8 +20,7 @@ function! airline#extensions#eclim#get_warnings() if !empty(eclimList) " Remove any non-eclim signs (see eclim#display#signs#Update) - " :help filter() ---- `the result **is zero** remove the item from the |List| or |Dictionary|.` - call filter(eclimList, "v:val.name != '^\(qf_\)\?\(error\|info\|warning\)$'") + call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\|info\\|warning\\)$"') if !empty(eclimList) let errorsLine = eclimList[0]['line']