Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d092a79
Add code from dev branch
shewitt-au Jul 10, 2025
924a9e9
Update PL
shewitt-au Jul 11, 2025
c9b95f3
Merge branch 'WerWolv:master' into accurate-column
shewitt-au Jul 11, 2025
c157d54
Merge branch 'accurate-column' of https://github.com/shewitt-au/Steve…
shewitt-au Jul 11, 2025
57bf43d
Merge branch 'master' of https://github.com/shewitt-au/SteveImHex
shewitt-au Jul 13, 2025
b181843
Longest line length
shewitt-au Jul 13, 2025
2767851
Update PL
shewitt-au Jul 14, 2025
5d604f4
Update PL
shewitt-au Jul 14, 2025
4375963
Start debug menu
shewitt-au Jul 15, 2025
f2161ae
Kind of works. Arrarys loc is off
shewitt-au Jul 16, 2025
3db158f
Arrays seem to work now
shewitt-au Jul 17, 2025
4c20938
Initial editor hookup
shewitt-au Jul 17, 2025
02edc2b
Clean up a a little
shewitt-au Jul 18, 2025
f8bfe96
Clean up a a little
shewitt-au Jul 18, 2025
dc4727c
Update PL
shewitt-au Jul 18, 2025
d7420d3
Update PL
shewitt-au Jul 18, 2025
6dc49cd
Attempt to fix macOS build
shewitt-au Jul 18, 2025
2a1d1b6
Clean up menus
shewitt-au Jul 18, 2025
96060d8
Various fixes
shewitt-au Jul 19, 2025
ced9b02
Merge
shewitt-au Jul 20, 2025
d1541ef
Fix PL reference
shewitt-au Jul 20, 2025
9e160b7
Client changes
shewitt-au Jul 20, 2025
96c8050
Fix accidental change
shewitt-au Jul 20, 2025
61044a0
Removed some comments
shewitt-au Jul 20, 2025
5018cb6
Merge branch 'master' into goto-in-pattern-editor
shewitt-au Jul 20, 2025
8d36954
Trigger CI rerun
shewitt-au Jul 20, 2025
266d8e6
Oops
shewitt-au Jul 20, 2025
5669307
Update PL
shewitt-au Jul 20, 2025
ea22fac
Strange stuff
shewitt-au Jul 20, 2025
d213717
Update PL
shewitt-au Jul 20, 2025
4ec0ea1
Merge branch 'master' of https://github.com/shewitt-au/SteveImHex
shewitt-au Jul 20, 2025
1204cc4
Merge branch 'master' into goto-in-pattern-editor
shewitt-au Jul 21, 2025
0b5d150
Merge branch 'master' into goto-in-pattern-editor
shewitt-au Jul 21, 2025
0bebe8c
Repair damage due to my poor git skills
shewitt-au Jul 21, 2025
c382a1f
Repair damage due to my poor git skills
shewitt-au Jul 21, 2025
99885bd
Repair damage due to my poor git skills
shewitt-au Jul 21, 2025
a9faa33
Repair damage due to my poor git skills
shewitt-au Jul 21, 2025
de081c4
Undo formatting changes
shewitt-au Jul 21, 2025
2c81011
Update PL
shewitt-au Jul 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/libimhex/include/hex/api/events/requests_interaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ namespace hex {
*/
EVENT_DEF(RequestPatternEditorSelectionChange, u32, u32);

/**
* @brief Requests the Pattern set the selection
*
* Requests the Pattern editor select a region.
*
* @param startLine the line selection starts on
* @param startcolumn the column selection starts on
* @param endLine the line selection ends on
* @param endcolumn the column selection ends on
*/
EVENT_DEF(RequestPatternEditorSetSelection, u32, u32, u32, u32);

/**
* @brief Requests a jump to a given pattern
*
Expand Down
1 change: 1 addition & 0 deletions plugins/builtin/romfs/lang/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,7 @@
"hex.builtin.view.hex_editor.menu.edit.insert": "Insert...",
"hex.builtin.view.hex_editor.menu.edit.insert_mode": "Insert Mode",
"hex.builtin.view.hex_editor.menu.edit.jump_to": "Follow selection",
"hex.builtin.view.hex_editor.menu.edit.goto_pattern_editor": "Goto in pattern editor",
"hex.builtin.view.hex_editor.menu.edit.jump_to.curr_pattern": "Current Pattern",
"hex.builtin.view.hex_editor.menu.edit.open_in_new_provider": "Open Selection View",
"hex.builtin.view.hex_editor.menu.edit.paste": "Paste",
Expand Down
12 changes: 12 additions & 0 deletions plugins/builtin/source/content/views/view_hex_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,18 @@ namespace hex::plugin::builtin {
},
[] { return ImHexApi::Provider::isValid() && ImHexApi::Provider::get()->isReadable(); });

/* Goto in pattern editor */
ContentRegistry::Interface::addMenuItem({ "hex.builtin.menu.edit", "hex.builtin.view.hex_editor.menu.edit.goto_pattern_editor" }, ICON_VS_GO_TO_FILE, 1870, Shortcut::None,
[] {
const auto selection = ImHexApi::HexEditor::getSelection();
auto patterns = ContentRegistry::PatternLanguage::getRuntime().getPatternsAtAddress(selection->getStartAddress());
if (!patterns.empty()) {
const auto &pl = patterns.front()->getVariableLocation();
RequestPatternEditorSetSelection::post(pl.line, pl.column, pl.line, pl.column+pl.length);
}
},
[] { return ImHexApi::Provider::isValid() && ImHexApi::HexEditor::isSelectionValid() && ImHexApi::HexEditor::getSelection()->getSize() <= sizeof(u64); } );

ContentRegistry::Interface::addMenuItemSeparator({ "hex.builtin.menu.edit" }, 1900);

/* Open in new provider */
Expand Down
11 changes: 11 additions & 0 deletions plugins/builtin/source/content/views/view_pattern_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,17 @@ namespace hex::plugin::builtin {
m_textEditor.get(provider).SetCursorPosition(coords);
});

RequestPatternEditorSetSelection::subscribe(this, [this](u32 startLine, u32 startcolumn, u32 endLine, u32 endcolumn) {
auto provider = ImHexApi::Provider::get();
if (startLine == 0 || endLine == 0)
return;

const TextEditor::Coordinates start = { int(startLine)-1, int(startcolumn)-1 };
const TextEditor::Coordinates end = { int(endLine)-1, int(endcolumn)-1 };
m_textEditor.get(provider).SetSelection(start, end);
m_textEditor.get(provider).SetCursorPosition(end);
});

RequestLoadPatternLanguageFile::subscribe(this, [this](const std::fs::path &path) {
this->loadPatternFile(path, ImHexApi::Provider::get());
});
Expand Down
Loading