Skip to content

Commit 114004b

Browse files
author
Damien Radtke
committed
---
yaml --- r: 160491 b: refs/heads/master c: 0207e25 h: refs/heads/master i: 160489: d77465c 160487: 70e68d1 v: v3
1 parent d7f2e66 commit 114004b

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 83f6a29f12c0e8231606d56b6a20df0dd0a78464
2+
refs/heads/master: 0207e25d70b1a5733b170ac9f16a9702db8ee8ed
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c9f6d696420107f82304b992cf623b806995fe18
55
refs/heads/try: 225de0d60f8ca8dcc62ab2fd8818ebbda4b58cfe

trunk/src/etc/vim/compiler/cargo.vim

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,26 @@
66
if exists('current_compiler')
77
finish
88
endif
9+
runtime compiler/rustc.vim
910
let current_compiler = "cargo"
1011

1112
if exists(':CompilerSet') != 2
1213
command -nargs=* CompilerSet setlocal <args>
1314
endif
1415

1516
if exists('g:cargo_makeprg_params')
16-
execute 'CompilerSet makeprg=cargo\ '.g:cargo_makeprg_params.'\ $*'
17+
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
1718
else
1819
CompilerSet makeprg=cargo\ $*
1920
endif
2021

21-
CompilerSet errorformat=
22-
\%f:%l:%c:\ %t%*[^:]:\ %m,
23-
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
24-
\%-G%f:%l\ %s,
25-
\%-G%*[\ ]^,
26-
\%-G%*[\ ]^%*[~],
27-
\%-G%*[\ ]...
28-
2922
" Allow a configurable global Cargo.toml name. This makes it easy to
3023
" support variations like 'cargo.toml'.
31-
if !exists('g:cargo_manifest_name')
32-
let g:cargo_manifest_name = 'Cargo.toml'
33-
endif
34-
35-
let s:local_manifest = fnamemodify(findfile(g:cargo_manifest_name, '.;'), ':p:h').'/'
24+
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
3625

26+
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
3727
if s:local_manifest != ''
28+
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
3829
augroup cargo
3930
au!
4031
au QuickfixCmdPost make call s:FixPaths()
@@ -46,23 +37,23 @@ if s:local_manifest != ''
4637
let qflist = getqflist()
4738
let manifest = s:local_manifest
4839
for qf in qflist
49-
if !qf['valid']
50-
let m = matchlist(qf['text'], '\v.*\(file://(.*)\)$')
51-
if len(m) > 0
40+
if !qf.valid
41+
let m = matchlist(qf.text, '(file://\(.*\))$')
42+
if !empty(m)
5243
let manifest = m[1].'/'
5344
" Manually strip another slash if needed; usually just an
5445
" issue on Windows.
55-
if manifest =~ '^/[A-Z]*:/'
46+
if manifest =~ '^/[A-Z]:/'
5647
let manifest = manifest[1:]
5748
endif
5849
endif
5950
continue
6051
endif
61-
let filename = bufname(qf['bufnr'])
52+
let filename = bufname(qf.bufnr)
6253
if filereadable(filename)
6354
continue
6455
endif
65-
let qf['filename'] = simplify(manifest.filename)
56+
let qf.filename = simplify(manifest.filename)
6657
call remove(qf, 'bufnr')
6758
endfor
6859
call setqflist(qflist, 'r')

0 commit comments

Comments
 (0)