aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/document.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/helix-view/src/document.rs b/helix-view/src/document.rs
index 2ab1602e..a2bd1c41 100644
--- a/helix-view/src/document.rs
+++ b/helix-view/src/document.rs
@@ -1049,10 +1049,9 @@ impl Document {
let cwdir = std::env::current_dir().expect("couldn't determine current directory");
self.path.as_ref().map(|path| {
- let path = if path.is_relative() {
- path.as_path()
- } else {
- path.strip_prefix(cwdir).unwrap_or(path.as_path())
+ let mut path = path.as_path();
+ if path.is_absolute() {
+ path = path.strip_prefix(cwdir).unwrap_or(path)
};
fold_home_dir(path)
})