Skip to content

Commit

Permalink
Refactor vim_mode initialization (inquire crate) to parse VISUAL envi…
Browse files Browse the repository at this point in the history
…ronment variable as boolean
  • Loading branch information
humblepenguinn committed Feb 27, 2024
1 parent 899c2e2 commit 9f48aa2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bin/envio/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ impl Command {
* Run the subcommand that was passed to the program
*/
pub fn run(&self) {
let vim_mode = if let Ok(_) = env::var("VISUAL") {
true
let vim_mode = if let Ok(value) = env::var("VISUAL") {
if let Ok(boolean_value) = value.parse::<bool>() {
boolean_value
} else {
false
}
} else {
false
};

match self {
Command::Create {
profile_name,
Expand Down

0 comments on commit 9f48aa2

Please sign in to comment.