@@ -1,6 +1,6 @@
1use anyhow::Error;
1use anyhow::Error;
2use std::future::Future;
2use std::future::Future;
3−use std::path::PathBuf;
3+use std::path::{Path, PathBuf};
5use helix_core::{
5use helix_core::{
6 syntax::LOADER, ChangeSet, Diagnostic, History, Position, Range, Rope, RopeSlice, Selection,
6 syntax::LOADER, ChangeSet, Diagnostic, History, Position, Range, Rope, RopeSlice, Selection,
@@ -201,6 +201,13 @@ impl Document {
201 &self.state.selection
201 &self.state.selection
204+ pub fn relative_path(&self) -> Option<&Path> {
205+ self.path.as_ref().map(|path| {
206+ path.strip_prefix(std::env::current_dir().unwrap())
204 // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
211 // pub fn slice<R>(&self, range: R) -> RopeSlice where R: RangeBounds {
205 // self.state.doc.slice
212 // self.state.doc.slice