From 664aa988f6d9cdb7b75218666fbe348c85ef8b29 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Wed, 4 Sep 2019 15:44:43 +0200 Subject: Update --- autoload/rustfmt.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'autoload/rustfmt.vim') diff --git a/autoload/rustfmt.vim b/autoload/rustfmt.vim index 908eb325..f469ac13 100644 --- a/autoload/rustfmt.vim +++ b/autoload/rustfmt.vim @@ -246,7 +246,12 @@ function! rustfmt#PreWrite() if rust#GetConfigVar('rustfmt_autosave_if_config_present', 0) if findfile('rustfmt.toml', '.;') !=# '' || findfile('.rustfmt.toml', '.;') !=# '' let b:rustfmt_autosave = 1 - let b:rustfmt_autosave_because_of_config = 1 + let b:_rustfmt_autosave_because_of_config = 1 + endif + else + if has_key(b:, '_rustfmt_autosave_because_of_config') + unlet b:_rustfmt_autosave_because_of_config + unlet b:rustfmt_autosave endif endif -- cgit v1.2.3