Ensure files sort after folders

This commit is contained in:
Jeremy Soller 2023-11-02 14:35:20 -06:00
parent 5e532534c3
commit ee2dea71e6
2 changed files with 5 additions and 2 deletions

View file

@ -507,7 +507,6 @@ impl cosmic::Application for App {
});
}
Message::PasteValue(value) => {
println!("Paste {:?}", value);
match self.active_tab() {
Some(tab) => {
let mut editor = tab.editor.lock().unwrap();

View file

@ -77,7 +77,11 @@ impl Ord for ProjectNode {
Self::File { .. } => return Ordering::Less,
_ => {}
},
_ => {}
// Files are always after folders
Self::File { .. } => match other {
Self::Folder { .. } => return Ordering::Greater,
_ => {}
},
}
self.name().cmp(other.name())
}