Bram Moolenaar | 3c2881d | 2017-03-21 19:18:29 +0100 | [diff] [blame] | 1 | " Vim compiler file |
| 2 | " Compiler: Cargo Compiler |
| 3 | " Maintainer: Damien Radtke <damienradtke@gmail.com> |
| 4 | " Latest Revision: 2014 Sep 24 |
| 5 | " For bugs, patches and license go to https://github.com/rust-lang/rust.vim |
| 6 | |
| 7 | if exists('current_compiler') |
| 8 | finish |
| 9 | endif |
| 10 | runtime compiler/rustc.vim |
| 11 | let current_compiler = "cargo" |
| 12 | |
| 13 | let s:save_cpo = &cpo |
| 14 | set cpo&vim |
| 15 | |
| 16 | if exists(':CompilerSet') != 2 |
| 17 | command -nargs=* CompilerSet setlocal <args> |
| 18 | endif |
| 19 | |
| 20 | if exists('g:cargo_makeprg_params') |
| 21 | execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*' |
| 22 | else |
| 23 | CompilerSet makeprg=cargo\ $* |
| 24 | endif |
| 25 | |
| 26 | " Ignore general cargo progress messages |
| 27 | CompilerSet errorformat+= |
| 28 | \%-G%\\s%#Downloading%.%#, |
| 29 | \%-G%\\s%#Compiling%.%#, |
| 30 | \%-G%\\s%#Finished%.%#, |
| 31 | \%-G%\\s%#error:\ Could\ not\ compile\ %.%#, |
| 32 | \%-G%\\s%#To\ learn\ more\\,%.%# |
| 33 | |
| 34 | let &cpo = s:save_cpo |
| 35 | unlet s:save_cpo |