Show "full" paths in the /file command output (#15483)
Same as /tabs command outputs them Before:   After:   Release Notes: - N/A
This commit is contained in:
parent
b160e13f20
commit
1bfea9d443
1 changed files with 9 additions and 4 deletions
|
@ -273,20 +273,25 @@ fn collect_files(
|
|||
continue;
|
||||
};
|
||||
if let Some(buffer) = open_buffer_task.await.log_err() {
|
||||
let snapshot = cx.read_model(&buffer, |buffer, _| buffer.snapshot())?;
|
||||
let buffer_snapshot =
|
||||
cx.read_model(&buffer, |buffer, _| buffer.snapshot())?;
|
||||
let prev_len = text.len();
|
||||
collect_file_content(&mut text, &snapshot, filename.clone());
|
||||
collect_file_content(
|
||||
&mut text,
|
||||
&buffer_snapshot,
|
||||
path_including_worktree_name.to_string_lossy().to_string(),
|
||||
);
|
||||
text.push('\n');
|
||||
if !write_single_file_diagnostics(
|
||||
&mut text,
|
||||
Some(&path_including_worktree_name),
|
||||
&snapshot,
|
||||
&buffer_snapshot,
|
||||
) {
|
||||
text.pop();
|
||||
}
|
||||
ranges.push((
|
||||
prev_len..text.len(),
|
||||
PathBuf::from(filename),
|
||||
path_including_worktree_name,
|
||||
EntryType::File,
|
||||
));
|
||||
text.push('\n');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue