aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-06-23 01:15:57 +0000
committerBlaž Hrastnik2021-06-23 01:15:57 +0000
commit7511110d82fe10d4560acf3675046c7ebfd821ae (patch)
treed9c44454b13809fb7dab9291a87f4e6b819d06b2 /helix-term
parentfd1ae35051b57e689f6e6ef7e03c552a78f3f33a (diff)
Fix build on master
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index f232f2c0..1370af45 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1365,17 +1365,17 @@ mod cmd {
.set_status(cx.editor.clipboard_provider.name().into());
}
- fn change_current_directory(editor: &mut Editor, args: &[&str], _: PromptEvent) {
+ fn change_current_directory(cx: &mut compositor::Context, args: &[&str], _: PromptEvent) {
let dir = match args.first() {
Some(dir) => dir,
None => {
- editor.set_error("target directory not provided".into());
+ cx.editor.set_error("target directory not provided".into());
return;
}
};
if let Err(e) = std::env::set_current_dir(dir) {
- editor.set_error(format!(
+ cx.editor.set_error(format!(
"Couldn't change the current working directory: {:?}",
e
));
@@ -1383,20 +1383,24 @@ mod cmd {
}
match std::env::current_dir() {
- Ok(cwd) => editor.set_status(format!(
+ Ok(cwd) => cx.editor.set_status(format!(
"Current working directory is now {}",
cwd.display()
)),
- Err(e) => editor.set_error(format!("Couldn't get the new working directory: {}", e)),
+ Err(e) => cx
+ .editor
+ .set_error(format!("Couldn't get the new working directory: {}", e)),
}
}
- fn show_current_directory(editor: &mut Editor, args: &[&str], _: PromptEvent) {
+ fn show_current_directory(cx: &mut compositor::Context, args: &[&str], _: PromptEvent) {
match std::env::current_dir() {
- Ok(cwd) => editor.set_status(format!("Current working directory is {}", cwd.display())),
- Err(e) => {
- editor.set_error(format!("Couldn't get the current working directory: {}", e))
- }
+ Ok(cwd) => cx
+ .editor
+ .set_status(format!("Current working directory is {}", cwd.display())),
+ Err(e) => cx
+ .editor
+ .set_error(format!("Couldn't get the current working directory: {}", e)),
}
}