Commit Graph

6292 Commits

Author SHA1 Message Date
paxcut
3b2e95b9d0 fixed UB created by erasing map elements in range for loop. 2026-03-24 06:43:41 -07:00
paxcut
c677aae7b1 fixed choppy text rendering when dragging the scrollbar with mouse (credit goes to WerWolv) and top margin adjustment when find/replace popup window first appears if it is blocking the entry under the cursor. 2026-03-20 10:46:34 -07:00
paxcut
f70268ea40 fixed crash when the marched delimiter near cursor becomes rii large if lines are removed. 2026-03-20 10:46:34 -07:00
paxcut
d454714428 fix for langs unit tests. I noticed a while back that the string Constants was defined twice in the english language file, so I removed the first one to what ended up in this pr. Apparently some other commit removed the second one so when i rebased the code this ended up deleting both instances thus producing the unit test failure that I assumed was not something I needed to worry about. 2026-03-20 10:46:34 -07:00
paxcut
8b938faf01 fixes for compilation errors 2026-03-20 10:46:34 -07:00
paxcut
324170e0d8 fixes for compilation errors 2026-03-20 10:46:34 -07:00
paxcut
e463df9fc4 fixes for compilation errors 2026-03-20 10:46:34 -07:00
paxcut
fe348d33e7 fixes for compilation errors 2026-03-20 10:46:34 -07:00
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
b57d9118c1 revert unintended commit 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.
nightly
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
WerWolv
eca7597aca patterns: Update pattern language 2026-03-19 18:19:01 +01:00
WerWolv
936b5b6312 build: Update GLFW backend 2026-03-19 18:17:46 +01:00
WerWolv
cea63f6561 build: Update ImGui 2026-03-19 18:17:46 +01:00
WerWolv
7083b6ab3e impr: Recursively trigger inherited view shortcuts 2026-03-19 18:17:46 +01: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
WerWolv
8d691b2e6a web: Fix display issues 2026-03-14 17:14:04 +01: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
27935b1234 impr: Mark SettingsVariable constructor as noexcept 2026-03-13 21:01:17 +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
WerWolv
21a94d67c2 patterns: Update pattern language 2026-03-10 12:48:05 +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
257d122a9f git: Downgrade LLVM to 21.X.X for macOS x86
LLVM 22+ no longer supports such old macOS versions
2026-03-09 21:07:27 +01:00
WerWolv
f7f70a16da patterns: Update pattern language 2026-03-09 21:06:46 +01: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
a2fc9325c9 fix: Shortcuts not getting dispatched to menu inherit view correctly 2026-03-03 13:46:16 +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
Nik
4a091f452e build: Update vcpkg manifest baseline commit 2026-03-01 10:37:57 +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
Sandy
1b90bb2c34 fix: Allow access to web docker app from outside container (#2659)
<!--
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
When trying to install imhex as a docker container using
`ghcr.io/werwolv/imhex/imhex-web`, the 9090 port doesn't connect to
anything on the host server. Connections to 9090 work inside the
container.

This is because the `localhost` address is `127.0.0.1` which does not
allow for access from outside.

### Implementation description
Change server binding from `localhost` to `0.0.0.0` to allow connections
from all interfaces, no just `lo`.

### Screenshots

<img width="345" height="257" alt="image"
src="https://github.com/user-attachments/assets/2825ac11-657c-4c34-b918-60c4a2750b0f"
/>

Where 9090 is before and 9091 is after the change.

Before
<img width="846" height="339" alt="image"
src="https://github.com/user-attachments/assets/4635467d-5190-49a8-bd97-f678f364250d"
/>

After
<img width="835" height="969" alt="image"
src="https://github.com/user-attachments/assets/af3f0228-ae0b-4704-89c9-50b32c2198eb"
/>


### Additional things
<!-- Anything else you would like to say -->
2026-03-01 09:34:32 +01:00
Nik
1018aea395 git: Update vcpkg committish for MSVC builds 2026-03-01 09:32:20 +01:00
paxcut
d20d6736b3 feat: main views retain focus on ui interactions (#2650)
Currently, interactions with the user interface, like changing providers, opening menus or even resizing windows, take the focus away from the main views. This PR resets focus to the child  (if view has no children then the view's window itself is used)  of the view that had focus before the interaction took place. 

It was tested by interacting with menus,  changing providers, using toolbar icons, using command palette, resizing windows or widgets of the view itself that are not children windows of the main view (e.g.  running a pattern and having focus return to the pattern editor when evaluation ends. or using the icons in the hex editor)  and also by selecting the main view itself. To clarify this last item, if you click on the view tab (not the provider tab but the view tab itself) the focus will be restored to the child that had focused before the tab was clicked 

There is no attempt to recover the active status of widgets within the window but it can be easily recovered by clicking the Tab key once. Some views, like the pattern data view, can set other views to focus depending on where they are clicked.

The implementation saves the the child sub-window in a pointer of the view and is only changed if another child is given focus. Then various UI interactions are detected with care not to change focus while the interaction occurs. The end of the interaction is detected by checking if undesired items are the ones that have focus (these undesired values only occur when the UI interaction ends) and if they are, then the focus is restored to the window that is stored in the view pointer.
2026-02-27 23:46:31 -07:00