2015-07-18 17:05:45 -04:00
|
|
|
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
|
|
|
|
|
2014-11-10 20:37:21 -05:00
|
|
|
" Vim compiler file
|
|
|
|
" Compiler: Cargo Compiler
|
|
|
|
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
2014-12-09 17:09:20 -05:00
|
|
|
" Latest Revision: 2014 Sep 24
|
2014-11-10 20:37:21 -05:00
|
|
|
|
2014-12-09 17:09:20 -05:00
|
|
|
if exists('current_compiler')
|
2014-11-10 20:37:21 -05:00
|
|
|
finish
|
|
|
|
endif
|
2014-12-09 17:09:20 -05:00
|
|
|
runtime compiler/rustc.vim
|
2014-11-10 20:37:21 -05:00
|
|
|
let current_compiler = "cargo"
|
|
|
|
|
2014-12-09 17:09:20 -05:00
|
|
|
if exists(':CompilerSet') != 2
|
2014-11-10 20:37:21 -05:00
|
|
|
command -nargs=* CompilerSet setlocal <args>
|
|
|
|
endif
|
|
|
|
|
2014-12-09 17:09:20 -05:00
|
|
|
if exists('g:cargo_makeprg_params')
|
|
|
|
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
|
|
|
else
|
|
|
|
CompilerSet makeprg=cargo\ $*
|
|
|
|
endif
|
2014-11-10 20:37:21 -05:00
|
|
|
|
2016-12-20 14:57:20 -05:00
|
|
|
" Ignore general cargo progress messages
|
|
|
|
CompilerSet errorformat+=
|
|
|
|
\%-G%\\s%#Downloading%.%#,
|
|
|
|
\%-G%\\s%#Compiling%.%#,
|
|
|
|
\%-G%\\s%#Finished%.%#,
|
|
|
|
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
|
|
|
\%-G%\\s%#To\ learn\ more\\,%.%#
|
2015-07-18 17:05:45 -04:00
|
|
|
|
|
|
|
endif
|