refactor: move statement elsewhere
This commit is contained in:
parent
a6e110937b
commit
fae93aa308
1 changed files with 12 additions and 12 deletions
|
@ -413,18 +413,6 @@ pub fn file_explorer(
|
|||
let directory_style = editor.theme.get("ui.text.directory");
|
||||
let directory_content = directory_content(&root)?;
|
||||
|
||||
let columns = [PickerColumn::new(
|
||||
"path",
|
||||
|(path, is_dir): &(PathBuf, bool), (root, directory_style): &(PathBuf, Style)| {
|
||||
let name = path.strip_prefix(root).unwrap_or(path).to_string_lossy();
|
||||
if *is_dir {
|
||||
Span::styled(format!("{}/", name), *directory_style).into()
|
||||
} else {
|
||||
name.into()
|
||||
}
|
||||
},
|
||||
)];
|
||||
|
||||
let yank_path: KeyHandler = Box::new(|cx, (path, _), _, _| {
|
||||
let register = cx
|
||||
.editor
|
||||
|
@ -664,6 +652,18 @@ pub fn file_explorer(
|
|||
)
|
||||
});
|
||||
|
||||
let columns = [PickerColumn::new(
|
||||
"path",
|
||||
|(path, is_dir): &(PathBuf, bool), (root, directory_style): &(PathBuf, Style)| {
|
||||
let name = path.strip_prefix(root).unwrap_or(path).to_string_lossy();
|
||||
if *is_dir {
|
||||
Span::styled(format!("{}/", name), *directory_style).into()
|
||||
} else {
|
||||
name.into()
|
||||
}
|
||||
},
|
||||
)];
|
||||
|
||||
let picker = Picker::new(
|
||||
columns,
|
||||
0,
|
||||
|
|
Loading…
Add table
Reference in a new issue