summaryrefslogtreecommitdiffstats
path: root/autoload/rustfmt.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/rustfmt.vim')
-rw-r--r--autoload/rustfmt.vim3
1 files changed, 3 insertions, 0 deletions
diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim
index 59ab3d3b..96fffb26 100644
--- a/autoload/rustfmt.vim
+++ b/autoload/rustfmt.vim
@@ -234,6 +234,9 @@ function! rustfmt#Cmd()
endfunction
function! rustfmt#PreWrite()
+ if !filereadable(expand("%@"))
+ return
+ endif
if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0)
if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# ''
let b:rustfmt_autosave = 1