fix(python): Fix venv name not showing when using pyenv (#1046)

This fixes an issue where the name of the virtual environment is not
being shown when using the `pyenv_version_name` setting.
This commit is contained in:
Thomas O'Donnell 2020-04-14 10:23:57 +02:00 committed by GitHub
parent 7c45f74d11
commit beed0acc6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -47,13 +47,13 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let python_version = get_python_version()?;
let formatted_version = format_python_version(&python_version);
module.create_segment("version", &SegmentConfig::new(&formatted_version));
};
if let Some(virtual_env) = get_python_virtual_env() {
module.create_segment(
"virtualenv",
&SegmentConfig::new(&format!(" ({})", virtual_env)),
);
};
if let Some(virtual_env) = get_python_virtual_env() {
module.create_segment(
"virtualenv",
&SegmentConfig::new(&format!(" ({})", virtual_env)),
);
};
Some(module)