vim-polyglot/compiler/rustc.vim

51 lines
1.1 KiB
VimL
Raw Normal View History

if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1
2013-09-26 06:44:31 -04:00
" Vim compiler file
" Compiler: Rust Compiler
" Maintainer: Chris Morgan <me@chrismorgan.info>
" Latest Revision: 2013 Jul 12
2017-09-27 13:57:29 -04:00
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
2013-09-26 06:44:31 -04:00
if exists("current_compiler")
2017-09-27 13:57:29 -04:00
finish
2013-09-26 06:44:31 -04:00
endif
let current_compiler = "rustc"
let s:cpo_save = &cpo
set cpo&vim
if exists(":CompilerSet") != 2
command -nargs=* CompilerSet setlocal <args>
endif
2015-12-06 05:31:38 -05:00
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
2013-09-26 06:44:31 -04:00
CompilerSet makeprg=rustc
else
CompilerSet makeprg=rustc\ \%
endif
2016-12-20 14:57:20 -05:00
" Old errorformat (before nightly 2016/08/10)
2013-09-26 06:44:31 -04:00
CompilerSet errorformat=
\%f:%l:%c:\ %t%*[^:]:\ %m,
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
\%-G%f:%l\ %s,
\%-G%*[\ ]^,
\%-G%*[\ ]^%*[~],
\%-G%*[\ ]...
2016-12-20 14:57:20 -05:00
" New errorformat (after nightly 2016/08/10)
CompilerSet errorformat+=
\%-G,
\%-Gerror:\ aborting\ %.%#,
\%-Gerror:\ Could\ not\ compile\ %.%#,
\%Eerror:\ %m,
\%Eerror[E%n]:\ %m,
\%Wwarning:\ %m,
\%Inote:\ %m,
\%C\ %#-->\ %f:%l:%c
2013-09-26 06:44:31 -04:00
let &cpo = s:cpo_save
unlet s:cpo_save
endif