Commit Graph

3185 Commits

Author SHA1 Message Date
paxcut
f9343c8e94 reverse_view is not widely available yet. 2026-03-20 10:46:34 -07:00
paxcut
1670607e38 Final touches to code folding for the pattern editor. Also added some recent fixes to make rebasing easier. 2026-03-20 10:46:34 -07:00
paxcut
c92b55e1b6 merge some of master's changes 2026-03-20 10:46:34 -07:00
paxcut
77eff651ed fix: code folding was not restored when loading projects or opening/importing patterns 2026-03-20 10:46:34 -07:00
paxcut
219f588cbe Made code faster and cleaned some code. 2026-03-20 10:46:34 -07:00
paxcut
0e2d7ee3bc fix: template argument delimiters failed to create folds.
The problem was using the identifier type to distinguish template delimiters from operators because types are not guaranteed to be set. The fix uses colors of the highlighting instead which should always be set when the folds are detected.
2026-03-20 10:46:34 -07:00
paxcut
d4879572fa Code fold support for pattern editor that mimics Clion's but with additional features
- Supports open/close delimiters {} () [] <> and keywords import, #include, #ifdef/#ifndef
- Supports block comments (doc or not) and consecutive single line comments.
- Closed folds are retained when exiting and reopening ImHex (saved in  pattern file itself)
- Folds can be chained together by closing and opening successive folds on the same line (only for delimited folds)
- Supports all styles for delimiter placing and allows comments between head and opening delimiter.
- Tooltip shows unfolded code when ellipsis are hovered.
- line numbers update on folded line navigation.
- Line+Column numbers displayed on tooltip by hovering line number field and pressing the shift key.
- Selections and breakpoints rendered on fold sections.
- Vertical line on left margin for matching delimiter visualization.
- Intuitive fold indicators inspired by Clion's editor code folds.
- Fold indicators change dynamically and highlight on hovering.
- Shortcuts to open/close single/all folds or recursively using same keys as Clion's editor.
- Folds open automatically on edits, find/replace, and breakpoints hit.
- Folds also open by clicking on ellipsis.
- Entirely original source code with no third party dependencies.

Not implemented:
- Custom folds based on selection. There is no syntax in pattern language to define independent blocks

Other fixes/changes/improvements
- Improved line number background color for better visibility.
2026-03-20 10:46:34 -07:00
paxcut
854535fec6 fix: Some variables are incorrectly highlighted as errors (#2690)
Non-auto function arguments of custom types defined inside a namespace
made the highlighter unable to check if member uses inside the function
are valid. Argument types were not parsed as fully qualified types and
the problem is corrected by making sure that fully qualified names are
used when they are found in function arguments.

An example of a pattern that shows the error is id3.hexpat in the which
uses unqualified types. In order to obtain the correct highlighting then
you have to add the namespace to all custom types even if they are being
used inside the namespace. Type names without namespace are considered
by the syntax highlighting code as belonging to the global scope
regardless of where the use takes place.
2026-03-20 10:45:01 -07:00
paxcut
a109e14ee3 fix: hex editor selection scrolling. (#2691)
Currently, if you start a selection in the middle of a largish file and
without letting go of the left mouse key you place the mouse at the top
line of the hex editor view then the selection will expand upwards and
at some point the start of the selection will go out of view. If then
you move the cursor (without letting go of the left mouse button) to the
last line of the hex editor view you would expect that the end of the
selection would start to increase in value, but it does nothing instead.
A similar issue occurs at the other end.

The problem is that the code only allows the upward scrolling when
moving the smaller address end to the first line, but it should also
allow it when the bigger address end to the first line. This means that
it doesn't matter which of the two ends is larger and this code removes
the conditions on the relative sizes of the two ends allowing for
selection growth to reverse direction.
2026-03-20 09:07:55 -07:00
paxcut
432e16e0c4 fix: pattern editor find/replace. (#2686)
A recent commit broke the pattern editor popups for fin/replace and goto
line. The problem was cause by changes to the function that returns the
name of the currently focused subwindow using a function that only
updates when ImHex main window losses focus. The commit was aimed at
fixing evaluation of shortcuts in pattern data view and pattern editor
simultaneously but missed to fix some shortcuts like cut and paste.

The fix substitutes how the subwindow is first selected by using the
result of the subwindow selection used by imhex to insure that menus and
other ui components don't steal focus from views. The function that
returns the name of the current focused subwindow was changed to use
this value. This fixes both the window popups of pattern editor and all
the shortcut duplications.
2026-03-14 16:59:32 -07:00
paxcut
f3ccbb9b84 fix: data inspector crash (#2685)
When ImHex starts it crashes from a segv fault caused by uninitialized
m_selectedRegion member.
Fixed by adding default initializer.
2026-03-13 19:21:38 -07:00
WerWolv
a4af283a37 impr: Allow data inspector shortcuts to work when hex editor is selected 2026-03-13 21:11:10 +01:00
WerWolv
ea0b97a066 fix: Main menu item overflow not showing all menus when some are hidden 2026-03-13 21:01:16 +01:00
WerWolv
e668feb807 feat: Add setting to only show data inspector rows matching exact size
#2684
2026-03-13 21:01:16 +01:00
paxcut
fbd6d6b9fc fix: popup when highlighting was cancelled (#2678)
Popup was caused by old code that set the interrupt flag when the
exception was caught in the thread and was already fixed in the code
folding branch.
2026-03-09 21:46:51 -07:00
WerWolv
aa5a83444d impr: Add Create new file and Open file menu entries to all views again 2026-03-09 11:53:25 +01:00
WerWolv
d25c80c0a5 fix: Shortcuts displayed in main menu not matching actual shortcuts 2026-03-09 11:52:08 +01:00
WerWolv
6f83b050cd fix: Pattern editor shortcuts applying when text input in pattern data view is selected 2026-03-09 10:46:55 +01:00
WerWolv
72e177aafc fix: Exception popup when canceling highlighting 2026-03-09 10:46:55 +01:00
Stephen Hewitt
5648378837 fix: Use UTC for data inspector date/time display (#2675)
time_t should not be converted to local time zone.
2026-03-08 21:29:42 +01:00
WerWolv
c1cdef7ca1 fix: Taskbar menu items showing up in command palette 2026-03-03 22:45:13 +01:00
WerWolv
4b07f7745b fix: Default font size being too small 2026-03-03 13:46:26 +01:00
WerWolv
380b1dbce3 fix: Menu bar focus issues 2026-03-03 13:45:54 +01:00
WerWolv
04a8bd6798 fix: Cached provider invalidation on reload not being done correctly 2026-03-02 10:07:57 +01:00
WerWolv
0cf27b9e9e fix: SSH Provider size detection not working correctly 2026-03-02 09:24:03 +01:00
qux-bbb
ffa8b0d0db lang: Update zh_CN.json (#2580) 2026-03-01 09:37:24 +01:00
WerWolvTranslationBot
ff65217b7e lang: Translations update from Weblate (#2624)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: PICOPress <choys041011@gmail.com>
Co-authored-by: Yaroslav <mrikso821@gmail.com>
2026-03-01 09:36:14 +01:00
paxcut
800a24b42e fix: Dirty projects on load. (#2649)
When a project is loaded it is set to dirty without any changes so that
it goes through the steps that patterns with changes go through. The fix
uses a different starting step that doesn't set the dirty flags when
changing providers or loading projects.
2026-02-09 20:21:51 -07:00
WerWolv
f476842008 impr: Make fonts look less blurry with Wayland fractional scaling 2026-02-06 22:12:40 +01:00
WerWolv
d39d107de4 fix: Copy As -> C# Array producing invalid syntax
Fixes #2648
2026-02-06 21:44:42 +01:00
Nemoumbra
70fdbd4a48 feat: Add request restart option to debug menu (#2636)
<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Hopefully this will help us debug the bugs that appear once ImHex
restarts a little easier.

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->
<img width="372" height="182" alt="image"
src="https://github.com/user-attachments/assets/1f27443e-9eaa-465a-b545-c2bbf0b56ca4"
/>
2026-01-29 21:16:55 +01:00
WerWolv
71c71c5bbf fix: Merge error 2026-01-29 20:18:17 +01:00
WerWolv
ade8c8f68d feat: Add Open Source File option to custom data inspector rows 2026-01-29 19:54:53 +01:00
WerWolv
16b02caf7a fix: Clicking on data inspector row clearing data inspector window if required size is zero 2026-01-29 19:54:36 +01:00
WerWolv
dc1c205fb1 fix: Inverted logic for custom inspector row evaluation 2026-01-29 19:53:48 +01:00
WerWolv
b974533f96 lang: Remove duplicate entry 2026-01-29 19:53:09 +01:00
WerWolv
b9e0a9f0e6 fix: Code indentation 2026-01-29 19:43:37 +01:00
WerWolv
954bcadd75 impr: Remove unused pattern drawer table flags 2026-01-29 19:43:28 +01:00
WerWolv
96a5a5d34c build: Output error message if capstone version is too low 2026-01-22 21:22:42 +01:00
WerWolv
928e0f227a fix: Banner tooltip text not being visible properly 2026-01-19 22:25:51 +01:00
WerWolv
0e41813cfc fix: [[format_write]] attribute not working as expected on integer and floating point types 2026-01-18 21:56:09 +01:00
WerWolvTranslationBot
06f4d12f10 lang: Translations update from Weblate (#2621)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: Rutar Andriy <RutarAndriy@gmail.com>
Co-authored-by: Yaroslav <mrikso821@gmail.com>
2026-01-17 21:45:41 +01:00
WerWolv
684c2e66fb fix: Ranges are still not available everywhere 2026-01-17 21:13:04 +01:00
WerWolv
4a311ed69f fix: Multiple issues with undo/redo stack handling 2026-01-17 21:03:36 +01:00
WerWolvTranslationBot
9a058efc79 lang: Translations update from Weblate (#2553)
Translations update from [Weblate](https://weblate.werwolv.net) for
[ImHex/Builtin](https://weblate.werwolv.net/projects/imhex/builtin/).


It also includes following components:

* [ImHex/Diffing](https://weblate.werwolv.net/projects/imhex/diffing/)

* [ImHex/UI](https://weblate.werwolv.net/projects/imhex/ui/)

*
[ImHex/Disassembler](https://weblate.werwolv.net/projects/imhex/disassembler/)

* [ImHex/Yara
Rules](https://weblate.werwolv.net/projects/imhex/yara-rules/)

* [ImHex/Fonts](https://weblate.werwolv.net/projects/imhex/fonts/)

* [ImHex/Hashes](https://weblate.werwolv.net/projects/imhex/hashes/)

* [ImHex/Remote](https://weblate.werwolv.net/projects/imhex/remote/)

* [ImHex/Script
Loader](https://weblate.werwolv.net/projects/imhex/script-loader/)

*
[ImHex/Visualizers](https://weblate.werwolv.net/projects/imhex/visualizers/)

* [ImHex/Windows](https://weblate.werwolv.net/projects/imhex/windows/)



Current translation status:

![Weblate translation
status](https://weblate.werwolv.net/widgets/imhex/-/builtin/horizontal-auto.svg)

Co-authored-by: Weblate <noreply@weblate.org>
Co-authored-by: MrClock <mrclock8163@gmail.com>
2026-01-12 23:26:15 +01:00
WerWolv
f4b2be9334 chore: Cleanup logs slightly 2026-01-07 21:27:41 +01:00
WerWolv
550fe8e4aa impr: Add MCP Client information to footer icon tooltip 2026-01-07 17:12:40 +01:00
WerWolv
2064aea3b6 fix: ImHex processes getting stuck in the background
Fixes #2611
2026-01-07 17:12:17 +01:00
WerWolv
3411bc4577 fix: Unused variable 2026-01-07 11:13:52 +01:00
WerWolv
6eedb469e9 fix: Notifications on Web build causing exceptions 2026-01-07 09:45:30 +01:00