Skip to content

Commit e703c70

Browse files
authored
Merge pull request #116 from stoklund/remove-fixpaths
Don't fix paths after running cargo.
2 parents 1851f69 + f6f2537 commit e703c70

File tree

2 files changed

+0
-52
lines changed

2 files changed

+0
-52
lines changed

compiler/cargo.vim

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,55 +19,10 @@ else
1919
CompilerSet makeprg=cargo\ $*
2020
endif
2121

22-
" Allow a configurable global Cargo.toml name. This makes it easy to
23-
" support variations like 'cargo.toml'.
24-
let s:cargo_manifest_name = get(g:, 'cargo_manifest_name', 'Cargo.toml')
25-
26-
function! s:is_absolute(path)
27-
return a:path[0] == '/' || a:path =~ '[A-Z]\+:'
28-
endfunction
29-
3022
" Ignore general cargo progress messages
3123
CompilerSet errorformat+=
3224
\%-G%\\s%#Downloading%.%#,
3325
\%-G%\\s%#Compiling%.%#,
3426
\%-G%\\s%#Finished%.%#,
3527
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
3628
\%-G%\\s%#To\ learn\ more\\,%.%#
37-
38-
let s:local_manifest = findfile(s:cargo_manifest_name, '.;')
39-
if s:local_manifest != ''
40-
let s:local_manifest = fnamemodify(s:local_manifest, ':p:h').'/'
41-
augroup cargo
42-
au!
43-
au QuickfixCmdPost make call s:FixPaths()
44-
augroup END
45-
46-
" FixPaths() is run after Cargo, and is used to change the file paths
47-
" to be relative to the current directory instead of Cargo.toml.
48-
function! s:FixPaths()
49-
let qflist = getqflist()
50-
let manifest = s:local_manifest
51-
for qf in qflist
52-
if !qf.valid
53-
let m = matchlist(qf.text, '(file://\(.*\))$')
54-
if !empty(m)
55-
let manifest = m[1].'/'
56-
" Manually strip another slash if needed; usually just an
57-
" issue on Windows.
58-
if manifest =~ '^/[A-Z]\+:/'
59-
let manifest = manifest[1:]
60-
endif
61-
endif
62-
continue
63-
endif
64-
let filename = bufname(qf.bufnr)
65-
if s:is_absolute(filename)
66-
continue
67-
endif
68-
let qf.filename = simplify(manifest.filename)
69-
call remove(qf, 'bufnr')
70-
endfor
71-
call setqflist(qflist, 'r')
72-
endfunction
73-
endif

doc/rust.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@ g:ftplugin_rust_source_path~
8888
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
8989
<
9090

91-
*g:cargo_manifest_name*
92-
g:cargo_manifest_name~
93-
Set this option to the name of the manifest file for your projects. If
94-
not specified it defaults to 'Cargo.toml' : >
95-
let g:cargo_manifest_name = 'Cargo.toml'
96-
<
97-
9891
*g:rustfmt_command*
9992
g:rustfmt_command~
10093
Set this option to the name of the 'rustfmt' executable in your $PATH. If

0 commit comments

Comments
 (0)