aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/picker.rs
diff options
context:
space:
mode:
authorKirawi2021-08-25 01:04:05 +0000
committerGitHub2021-08-25 01:04:05 +0000
commitb99db7c6875f74a15dcfb0cfdb3334c837d4aab1 (patch)
tree38656c3884fc7e49234af6daf826a7fb70748b9d /helix-term/src/ui/picker.rs
parentbf5b9a9f354135933d7970863cf81e5a36585d03 (diff)
Move path util functions from helix-term to helix-core (#650)
Diffstat (limited to 'helix-term/src/ui/picker.rs')
-rw-r--r--helix-term/src/ui/picker.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/helix-term/src/ui/picker.rs b/helix-term/src/ui/picker.rs
index a864ab6d..ef2c434c 100644
--- a/helix-term/src/ui/picker.rs
+++ b/helix-term/src/ui/picker.rs
@@ -17,7 +17,6 @@ use std::{borrow::Cow, collections::HashMap, path::PathBuf};
use crate::ui::{Prompt, PromptEvent};
use helix_core::Position;
use helix_view::{
- document::canonicalize_path,
editor::Action,
graphics::{Color, CursorKind, Margin, Rect, Style},
Document, Editor,
@@ -54,7 +53,11 @@ impl<T> FilePicker<T> {
self.picker
.selection()
.and_then(|current| (self.file_fn)(editor, current))
- .and_then(|(path, line)| canonicalize_path(&path).ok().zip(Some(line)))
+ .and_then(|(path, line)| {
+ helix_core::path::get_canonicalized_path(&path)
+ .ok()
+ .zip(Some(line))
+ })
}
fn calculate_preview(&mut self, editor: &Editor) {