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