Feature/code folding (#2688)
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.
- Tool-tip 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. P
paxcut committed
c3998390e15492eeee6bf1869a36949bea26ba17
Parent: b790a21
Committed by GitHub <noreply@github.com>
on 4/18/2026, 5:26:39 PM