Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/editor.rs')
| -rw-r--r-- | helix-view/src/editor.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 6c585a8a..151b2653 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -1079,7 +1079,7 @@ pub struct Editor { redraw_timer: Pin<Box<Sleep>>, last_motion: Option<Motion>, pub last_completion: Option<CompleteAction>, - pub last_cwd: Option<PathBuf>, + last_cwd: Option<PathBuf>, pub exit_code: i32, @@ -2209,6 +2209,16 @@ impl Editor { current_view.id } } + + pub fn set_cwd(&mut self, path: &Path) -> std::io::Result<()> { + self.last_cwd = helix_stdx::env::set_current_working_dir(path)?; + self.clear_doc_relative_paths(); + Ok(()) + } + + pub fn get_last_cwd(&mut self) -> Option<&Path> { + self.last_cwd.as_deref() + } } fn try_restore_indent(doc: &mut Document, view: &mut View) { |