Skip to content

Commit

Permalink
Update helix-term/src/commands.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
  • Loading branch information
michaelBelsanti and the-mikedavis authored Aug 21, 2023
1 parent 2b4a438 commit 5b8179b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,10 +1160,10 @@ fn goto_file_impl(cx: &mut Context, action: Action) {
let (view, doc) = current_ref!(cx.editor);
let text = doc.text();
let selections = doc.selection(view.id);
let rel_path = match doc.relative_path() {
Some(p) => p.parent().unwrap().to_path_buf(),
_ => Path::new("").to_path_buf(),
};
let rel_path = doc
.relative_path()
.map(|path| path.parent().unwrap().to_path_buf())
.unwrap_or_default();
let mut paths: Vec<_> = selections
.iter()
.map(|r| text.slice(r.from()..r.to()).to_string())
Expand Down

0 comments on commit 5b8179b

Please sign in to comment.