Skip to content

Commit

Permalink
Add mime type detection for selection
Browse files Browse the repository at this point in the history
  • Loading branch information
crumblingstatue committed Oct 16, 2024
1 parent e05aa19 commit c58f98e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/gui/top_menu/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ pub fn ui(ui: &mut egui::Ui, gui: &mut Gui, app: &App) {
);
ui.close_menu();
}
if let Some(region) = app.hex_ui.selection() {
if ui.button("Determine data mime type of selection").clicked() {
gui.msg_dialog.open(
Icon::Info,
"Data mime type under cursor",
tree_magic_mini::from_u8(&app.data[region.begin..=region.end]).to_string(),
);
ui.close_menu();
}
}
ui.separator();
if ui.button("Diff with file...").clicked() {
gui.fileops.diff_with_file(app.source_file());
Expand Down

0 comments on commit c58f98e

Please sign in to comment.