Add an option to force vim plug update (#795)

* Add an option to force vim plug update (fix #751)

* Rustfmt

* Update src/config.rs

Co-authored-by: M*C*O <mcofficer@gmx.de>

Co-authored-by: M*C*O <mcofficer@gmx.de>
This commit is contained in:
Roey Darwish Dror
2021-11-06 06:06:10 +02:00
committed by GitHub
parent d002b1ab1a
commit 23c9908a6a
3 changed files with 32 additions and 7 deletions

View File

@@ -212,6 +212,12 @@ pub struct Composer {
self_update: Option<bool>,
}
#[derive(Deserialize, Default, Debug)]
#[serde(deny_unknown_fields)]
pub struct Vim {
force_plug_update: Option<bool>,
}
#[derive(Deserialize, Default, Debug)]
#[serde(deny_unknown_fields)]
/// Configuration file
@@ -244,6 +250,7 @@ pub struct ConfigFile {
git: Option<Git>,
windows: Option<Windows>,
npm: Option<NPM>,
vim: Option<Vim>,
firmware: Option<Firmware>,
vagrant: Option<Vagrant>,
flatpak: Option<Flatpak>,
@@ -626,6 +633,15 @@ impl Config {
.unwrap_or(false)
}
/// Whether to force plug update in Vim
pub fn force_vim_plug_update(&self) -> bool {
self.config_file
.vim
.as_ref()
.and_then(|c| c.force_plug_update)
.unwrap_or_default()
}
/// Whether to send a desktop notification at the beginning of every step
#[allow(dead_code)]
pub fn notify_each_step(&self) -> bool {