File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77- Automatically open the current file if Rustlings is running in a VS Code terminal
88- Automatically open the current file with ` $EDITOR ` in a new pane if Rustlings is running in [ Zellij] ( https://zellij.dev )
9+ - New argument ` --no-editor ` to disable automatic opening of the current file in VS Code or Zellij
910- New argument ` --edit-cmd ` to communicate with an editor running in a different process to open the current exercise
1011- Show the file link of the current exercise when running ` rustlings hint ` and ` rustlings reset `
1112
Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ use crate::dev::DevCommand;
88pub struct Args {
99 #[ command( subcommand) ]
1010 pub command : Option < Command > ,
11+ /// Disable automatic opening of the current file in VS Code or Zellij.
12+ /// Ignores `--edit-cmd`
13+ #[ arg( long) ]
14+ pub no_editor : bool ,
1115 /// Open the current exercise by running `EDIT_CMD EXERCISE_PATH`.
1216 /// The command is not allowed to block (e.g. `vim`).
1317 /// It should communicate with an editor in a different process.
Original file line number Diff line number Diff line change @@ -62,7 +62,12 @@ fn main() -> Result<ExitCode> {
6262 }
6363
6464 let vs_code_term = env:: var_os ( "TERM_PROGRAM" ) . is_some_and ( |v| v == "vscode" ) ;
65- let editor = Editor :: new ( args. edit_cmd , vs_code_term) ?;
65+ let editor = if args. no_editor {
66+ None
67+ } else {
68+ Editor :: new ( args. edit_cmd , vs_code_term) ?
69+ } ;
70+
6671 let ( mut app_state, state_file_status) = AppState :: new (
6772 info_file. exercises ,
6873 info_file. final_message . unwrap_or_default ( ) ,
You can’t perform that action at this time.
0 commit comments