on master help sign in
Fix build on master
commit7511110d82fe10d4560acf3675046c7ebfd821ae authorBlaž Hrastnik <blaz@mxxn.io> dateWed 23 Jun 2021, 10:15 (5 years ago) parentfd1ae35
1 file changed+14−10
helix-term/src/commands.rs+14−10
helix-term/src/commands.rs+14−10
@@ -1365,17 +1365,17 @@ mod cmd {
13651365 .set_status(cx.editor.clipboard_provider.name().into());
13661366 }
13671367
1368− fn change_current_directory(editor: &mut Editor, args: &[&str], _: PromptEvent) {
1368+ fn change_current_directory(cx: &mut compositor::Context, args: &[&str], _: PromptEvent) {
13691369 let dir = match args.first() {
13701370 Some(dir) => dir,
13711371 None => {
1372− editor.set_error("target directory not provided".into());
1372+ cx.editor.set_error("target directory not provided".into());
13731373 return;
13741374 }
13751375 };
13761376
13771377 if let Err(e) = std::env::set_current_dir(dir) {
1378− editor.set_error(format!(
1378+ cx.editor.set_error(format!(
13791379 "Couldn't change the current working directory: {:?}",
13801380 e
13811381 ));
@@ -1383,20 +1383,24 @@ mod cmd {
13831383 }
13841384
13851385 match std::env::current_dir() {
1386− Ok(cwd) => editor.set_status(format!(
1386+ Ok(cwd) => cx.editor.set_status(format!(
13871387 "Current working directory is now {}",
13881388 cwd.display()
13891389 )),
1390− Err(e) => editor.set_error(format!("Couldn't get the new working directory: {}", e)),
1390+ Err(e) => cx
1391+ .editor
1392+ .set_error(format!("Couldn't get the new working directory: {}", e)),
13911393 }
13921394 }
13931395
1394− fn show_current_directory(editor: &mut Editor, args: &[&str], _: PromptEvent) {
1396+ fn show_current_directory(cx: &mut compositor::Context, args: &[&str], _: PromptEvent) {
13951397 match std::env::current_dir() {
1396− Ok(cwd) => editor.set_status(format!("Current working directory is {}", cwd.display())),
1397− Err(e) => {
1398− editor.set_error(format!("Couldn't get the current working directory: {}", e))
1399− }
1398+ Ok(cwd) => cx
1399+ .editor
1400+ .set_status(format!("Current working directory is {}", cwd.display())),
1401+ Err(e) => cx
1402+ .editor
1403+ .set_error(format!("Couldn't get the current working directory: {}", e)),
14001404 }
14011405 }
14021406