GExperts 1.4.0 is available. It brings 42 new features and enhancements and 137 bug fixes, among them the GExperts Code Formatter as the IDE’s Format Source command in Delphi 13.2, a GExperts menu grouped into submenus, copying and pasting components together with their event handlers, and a long list of fixes for finding units the way the compiler does.
For the impatient: head over to the GExperts download page to get it.
It took me so long because I wanted to fix all known bugs. I did not quite reach that goal, but I came close. This would not have been possible without Claude Code. It did not just help me find and fix lots of bugs, some of which I would not have been able to fix myself, but also improved the documentation (alas not the help, I still have to find a way to let it do that too). For those who do not want to use anything AI generated (you probably call it "AI slop"), I have created a tag before-AI in subversion. Just get these ancient and bug ridden sources and run with them if you like. Remember to adhere to the license though.
Why 1.4 and what that means for your settings
GExperts has been at version 1.3.x for many years, mostly because I didn’t want to go through all the changes necessary to create a version 1.4. Again, Claude Code helped here, including a simple way to carry the settings over.
GExperts 1.4 keeps its settings under a registry key of its own, GExperts-1.4 below the IDE’s key, instead of GExperts-1.3. You don’t have to configure anything again: on its first start it copies the settings of the newest older version there. The older version keeps its own settings, so changes made in 1.4 do not reach it, and if you go back to 1.3.29 you get the settings as they were when you installed 1.4. The files in GExperts’ data folder, e.g. the Code Librarian or the Macro Templates, are shared by both versions.
Code Formatter
Delphi 13 no longer has a code formatter of its own, but Delphi 13.2 lets a plugin provide one. A new option on the Misc. tab of the Code Formatter configuration makes the IDE’s Format Source command (Ctrl+D and the editor’s context menu) use the GExperts Code Formatter. I wrote about it in GExperts Code Formatter as the IDE’s Format Source command in Delphi 13.2.
Two new editor experts format more than one unit at a time: “Code Formatter for Project Units” formats all units of the current project, “Code Formatter for Project Group Units” those of all projects in the project group, each unit with the settings that apply to it. Units from outside the projects’ directories, e.g. those of a shared library, are listed by folder in the confirmation, so you decide which of them get formatted. A run that takes longer than half a second shows a progress window with a Cancel button. Thanks to Ian Branch, who requested this and contributed a large part of it.
Formatting no longer damages breakpoints: in Delphi 6 and 7 it silently removed the breakpoints of the unit, elsewhere breakpoints could end up twice or disappear, and copies of other units’ breakpoints could appear on the wrong lines (the last one found and fixed by Ian Branch). In Delphi 13.2 the bookmarks also stay where they belong.
The setting “Never before then, do” is now “Line break before then, do” with the choices Unchanged, Never and Always (requested by Lars Fosdal), and the preview in the configuration dialog shows the same code side by side even where formatting added or removed lines.
The GExperts menu in submenus
With all experts enabled, the GExperts menu had grown so long that it needed one or more “More” submenus on most screens. The experts are now grouped into the submenus Editor, Form Designer, IDE, Navigation, Project and Tools, see GExperts menu grouped into submenus. If you prefer the flat menu, an option on the IDE tab of the configuration switches the grouping off. Thanks to Stefan Glienke for the suggestion.
Copy and paste components with their event handlers
When you paste components into another form, the IDE drops all their event links. Two new experts in the form designer’s context menu, Copy with Event Handlers and Paste with Event Handlers, keep them and create the missing methods in the target form. Details are in GExperts: Copy and paste components with their event handlers.
Keyboard shortcut conflicts
GExperts now knows which keyboard shortcuts the IDE and other plugins already use, including the commands the IDE handles itself and the New IDE Classic and New IDE Emacs keyboard mappings. A shortcut of an active expert that collides with one of them, or with another expert, is reported when the IDE starts and marked with a red frame in the configuration dialog, which also names the plugin that has it. See GExperts shortcut conflicts.
Smaller things you may notice
- Toggle Message View, by default on Alt+Shift+M, shows the message view, gives it the focus or hides it again, and stops the IDE from making it a few pixels smaller every time it is shown.
- Ctrl+C and Ctrl+X can copy or cut without a selection: the identifier at the cursor or the current line, see this post.
- IDE Menu Shortcuts is now IDE Menu Shortcuts and Visibility: it can hide items or whole submenus of the IDE’s main menu, and a “Revert to Default” button restores the menu.
- What the IDE dialog enhancements do is configured for each dialog separately, on a new Forms tab of the configuration dialog.
- When you add a unit in the Uses Clause Manager that was found in one of the favorite directories of the Search Path dialog, OK offers to add that directory to the project’s search path.
- Select Components filters the list as you type, leaving only the matching components and their parents.
- PE Information has filter fields for the Exports and Imports lists, and the lists can be sorted by any column.
- Grep checks a regular expression while you type it, and files that cannot be searched are listed in one message at the end instead of one error dialog each.
- Move to Matching Delimiter and Locate Matching Delimiter treat the quotes of a string literal as a pair, also those of a multiline string.
- Remove Matching Lines keeps several named searches.
- The dialogs for breakpoints can be made wider, so a long condition fits.
Bug fixes
137 of them. Besides the formatter fixes above, a few worth calling out:
- The Uses Clause Manager, Open Unit, Project Dependencies, Declare Variable and Grep with “Parse map file” now find a unit the way the compiler of the running IDE does: in its order, with unit aliases, unit scope names and the default namespace, and with the .dcu file from the library path taking precedence over a .pas file of the same name elsewhere. The Uses Clause Manager also got noticeably faster with large projects.
- GExperts windows behave on monitors with different scaling: windows no longer grow every time they are opened, docked windows take the scaling of the window they are docked into, and the To Do list, Unit Tags and Vertical Tabs now scale at all. Thanks to Ulrich Kobsa for a report with a fix.
- In the 64-bit IDE, opening the configuration dialog could raise an access violation in coreide370.bpl, caused by a ToolsAPI declaration, see this post. Thanks to markbd13 for the report and the fix.
- Loading and unloading other packages could still remove GExperts’ keyboard shortcuts from the IDE. Thanks to Plamen Marinov for the report and analysis.
- Two IDEs of the same Delphi version saving their settings at the same time, e.g. when both are closed together, no longer fail with “Failed to set data for ‘Count'” and lose a list from the settings.
- Evaluate/Modify no longer makes the IDE raise access violations after it has been closed.
- The Code Formatter no longer overwrites a capitalization file it could not read with an empty one.
- The GExperts message boxes show their own title again and are no longer scaled twice on monitors above 100%. The message boxes of most experts are now centered on the dialog they belong to instead of the middle of the primary screen.
The bug tracker is down to three open reports again.
Thanks to everybody who reported bugs, suggested features or sent fixes: Ian Branch, Lars Fosdal, Plamen Marinov, Ulrich Kobsa, markbd13, ura, limelect, Philip von Melle, TigerLilly, delphichem1 and Anders Melander.
Discussion about this in the corresponding post in the international Delphi Praxis forum.