mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-04 09:13:30 +02:00
Check if editor program exists before choosing it
This commit is contained in:
+2
-1
@@ -69,6 +69,7 @@ impl AppState {
|
||||
exercise_infos: Vec<ExerciseInfo>,
|
||||
final_message: &'static str,
|
||||
editor: Option<Editor>,
|
||||
vs_code_term: bool,
|
||||
) -> Result<(Self, StateFileStatus)> {
|
||||
let cmd_runner = CmdRunner::build()?;
|
||||
let mut state_file = OpenOptions::new()
|
||||
@@ -178,7 +179,7 @@ impl AppState {
|
||||
official_exercises: !Path::new("info.toml").exists(),
|
||||
cmd_runner,
|
||||
// VS Code has its own file link handling
|
||||
emit_file_links: !matches!(editor, Some(Editor::VSCode)),
|
||||
emit_file_links: !vs_code_term,
|
||||
editor,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user