@@ -70,7 +70,6 @@ pub enum IndentStyle {
7070}
7171
7272pub struct Document {
73− // rope + selection
7473 pub(crate) id: DocumentId,
7574 text: Rope,
7675 pub(crate) selections: HashMap<ViewId, Selection>,
@@ -408,12 +407,13 @@ pub fn normalize_path(path: &Path) -> PathBuf {
408407/// This function is used instead of `std::fs::canonicalize` because we don't want to verify
409408/// here if the path exists, just normalize it's components.
410409pub fn canonicalize_path(path: &Path) -> std::io::Result<PathBuf> {
411− let normalized = normalize_path(path);
412− if normalized.is_absolute() {
413− Ok(normalized)
410+ let path = if path.is_relative() {
411+ std::env::current_dir().map(|current_dir| current_dir.join(path))?
414412 } else {
415− std::env::current_dir().map(|current_dir| current_dir.join(normalized))
416− }
413+ path.to_path_buf()
414+ };
415+
416+ Ok(normalize_path(&path))
417417}
418418
419419use helix_lsp::lsp;