File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 23
23
" support variations like 'cargo.toml'.
24
24
let s: cargo_manifest_name = get (g: , ' cargo_manifest_name' , ' Cargo.toml' )
25
25
26
+ function ! s: is_absolute (path )
27
+ return a: path [0 ] == ' /' || a: path = ~ ' [A-Z]\+:'
28
+ endfunction
29
+
26
30
let s: local_manifest = findfile (s: cargo_manifest_name , ' .;' )
27
31
if s: local_manifest != ' '
28
- let s: local_manifest = fnamemodify (s: local_manifest , ' :p:h' ).' /'
32
+ let s: local_manifest = fnamemodify (s: local_manifest , ' :p:h' ).' /'
29
33
augroup cargo
30
34
au !
31
35
au QuickfixCmdPost make call s: FixPaths ()
@@ -43,14 +47,14 @@ if s:local_manifest != ''
43
47
let manifest = m [1 ].' /'
44
48
" Manually strip another slash if needed; usually just an
45
49
" issue on Windows.
46
- if manifest = ~ ' ^/[A-Z]:/'
50
+ if manifest = ~ ' ^/[A-Z]\+ :/'
47
51
let manifest = manifest[1 :]
48
52
endif
49
53
endif
50
54
continue
51
55
endif
52
56
let filename = bufname (qf.bufnr )
53
- if filereadable (filename)
57
+ if s: is_absolute (filename)
54
58
continue
55
59
endif
56
60
let qf.filename = simplify (manifest.filename)
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ g:ftplugin_rust_source_path~
79
79
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
80
80
<
81
81
82
+ *g:cargo_manifest_name*
83
+ g:cargo_manifest_name~
84
+ Set this option to the name of the manifest file for your projects. If
85
+ not specified it defaults to 'Cargo.toml' : >
86
+ let g:cargo_manifest_name = 'Cargo.toml'
87
+ <
88
+
82
89
==============================================================================
83
90
COMMANDS *rust-commands*
84
91
You can’t perform that action at this time.
0 commit comments