Remove .vim file when disabled
This commit is contained in:
parent
9c997a5165
commit
bff3bdb120
@ -1,5 +1,5 @@
|
|||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::fs::OpenOptions;
|
use std::fs::{remove_file, OpenOptions};
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
use dirs;
|
use dirs;
|
||||||
@ -27,6 +27,7 @@ impl NvimConfig {
|
|||||||
Ok(file) => Some(file),
|
Ok(file) => Some(file),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
NvimConfig::config_path().map(remove_file);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ impl Manager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn load_config(&self) -> Option<PlugManagerConfigSource> {
|
pub fn generate_config(&self) -> Option<PlugManagerConfigSource> {
|
||||||
if self.store.is_enabled() {
|
if self.store.is_enabled() {
|
||||||
Some(PlugManagerConfigSource::new(&self.store))
|
Some(PlugManagerConfigSource::new(&self.store))
|
||||||
} else {
|
} else {
|
||||||
|
@ -116,7 +116,7 @@ impl<'a> Ui<'a> {
|
|||||||
let mut manager = self.manager.borrow_mut();
|
let mut manager = self.manager.borrow_mut();
|
||||||
manager.clear_removed();
|
manager.clear_removed();
|
||||||
manager.save();
|
manager.save();
|
||||||
if let Some(config_path) = NvimConfig::new(manager.load_config()).generate_config() {
|
if let Some(config_path) = NvimConfig::new(manager.generate_config()).generate_config() {
|
||||||
if let Some(path) = config_path.to_str() {
|
if let Some(path) = config_path.to_str() {
|
||||||
manager.vim_plug.reload(path);
|
manager.vim_plug.reload(path);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user