From 83f6a29f12c0e8231606d56b6a20df0dd0a78464 Mon Sep 17 00:00:00 2001 From: Damien Radtke Date: Tue, 7 Oct 2014 13:57:10 -0500 Subject: [PATCH] Use rustc's errorformat and add option to specify permanent parameters. --- src/etc/vim/compiler/cargo.vim | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/etc/vim/compiler/cargo.vim b/src/etc/vim/compiler/cargo.vim index d707ae828692..4b8212511cba 100644 --- a/src/etc/vim/compiler/cargo.vim +++ b/src/etc/vim/compiler/cargo.vim @@ -3,17 +3,28 @@ " Maintainer: Damien Radtke " Latest Revision: 2014 Sep 24 -if exists("current_compiler") +if exists('current_compiler') finish endif let current_compiler = "cargo" -if exists(":CompilerSet") != 2 +if exists(':CompilerSet') != 2 command -nargs=* CompilerSet setlocal endif -CompilerSet errorformat=%A%f:%l:%c:\ %m,%-Z%p^,%-C%.%# -CompilerSet makeprg=cargo\ $* +if exists('g:cargo_makeprg_params') + execute 'CompilerSet makeprg=cargo\ '.g:cargo_makeprg_params.'\ $*' +else + CompilerSet makeprg=cargo\ $* +endif + +CompilerSet errorformat= + \%f:%l:%c:\ %t%*[^:]:\ %m, + \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m, + \%-G%f:%l\ %s, + \%-G%*[\ ]^, + \%-G%*[\ ]^%*[~], + \%-G%*[\ ]... " Allow a configurable global Cargo.toml name. This makes it easy to " support variations like 'cargo.toml'.