@@ -14,9 +14,9 @@ function! s:nearest_cargo(...) abort
14
14
15
15
let l: is_getcwd = get (a: , 1 , 0 )
16
16
if l: is_getcwd
17
- let l: starting_path = get (a: , 2 , getcwd ())
17
+ let l: starting_path = get (a: , 2 , getcwd ())
18
18
else
19
- let l: starting_path = get (a: , 2 , expand (' %:p:h' ))
19
+ let l: starting_path = get (a: , 2 , expand (' %:p:h' ))
20
20
endif
21
21
22
22
return findfile (' Cargo.toml' , l: starting_path . ' ;' )
@@ -29,13 +29,13 @@ endfunction
29
29
function ! cargo#nearestWorkspaceCargo (is_getcwd) abort
30
30
let l: nearest = s: nearest_cargo (a: is_getcwd )
31
31
while l: nearest !=# ' '
32
- for l: line in readfile (l: nearest , ' ' , 0x100 )
33
- if l: line = ~# ' \V[workspace]'
34
- return l: nearest
35
- endif
36
- endfor
37
- let l: next = fnamemodify (l: nearest , ' :p:h:h' )
38
- let l: nearest = s: nearest_cargo (0 , l: next )
32
+ for l: line in readfile (l: nearest , ' ' , 0x100 )
33
+ if l: line = ~# ' \V[workspace]'
34
+ return l: nearest
35
+ endif
36
+ endfor
37
+ let l: next = fnamemodify (l: nearest , ' :p:h:h' )
38
+ let l: nearest = s: nearest_cargo (0 , l: next )
39
39
endwhile
40
40
return ' '
41
41
endfunction
@@ -45,7 +45,7 @@ function! cargo#nearestRootCargo(is_getcwd) abort
45
45
" regular Cargo.toml
46
46
let l: workspace_cargo = cargo#nearestWorkspaceCargo (a: is_getcwd )
47
47
if l: workspace_cargo !=# ' '
48
- return l: workspace_cargo
48
+ return l: workspace_cargo
49
49
endif
50
50
return s: nearest_cargo (a: is_getcwd )
51
51
endfunction
@@ -84,4 +84,4 @@ function! cargo#bench(args)
84
84
call cargo#cmd (" bench " . a: args )
85
85
endfunction
86
86
87
- " vim: set noet sw = 4 sts = 4 ts = 8 :
87
+ " vim: set et sw = 4 sts = 4 ts = 8 :
0 commit comments