In most text editors, if you type in a {
or "
(you get the idea), the editor will automatically enter the opposite character, and put your cursor in between. I noticed that UltraEdit does not do this. Is there any way that I can setup UltraEdit so it will close a matching brace?
UltraEdit close matching brace
898 views Asked by Scott Wayne At
1
UltraEdit for Windows v23.20 introduced features for smart inserting of braces and quotes with Brace auto-completion and String auto-completion.
The settings for customization of those two features can be found in configuration at Editor - Braces / strings.
UEStudio v16.20 introduced the same features with same configuration settings as UltraEdit for Windows v23.20.
Former versions of UEStudio, the IDE with UltraEdit as core editing engine, have these features from the beginning which could be customized in configuration at IDE - IntelliTips - Miscellaneous by opening from menu Advanced with a click on menu item Configuration or clicking on ribbon tab Advanced on item Settings.
But versions of UltraEdit for Windows prior v23.20 don't have those features.
However, a non smart insert of
{
and}
with setting caret between can be easily achieved with a macro which has the key pressed to insert{
assigned to the macro as hotkey.How to create one or more new UltraEdit macros saved all together into a single macro file being configured for automatic load on startup of UltraEdit is explained in my answer on Search and replace with term list?
The UltraEdit macro code for
{
is:The same concept can be used for:
a double quote
an opening square bracket
and an opening round bracket
It is also possible to customize the macro for certain file types, for example:
This macro inserts
}
additionally to{
on pressing key for{
only when file extension of active file is c, cpp or h (in any case). For all other files just{
is entered on pressing hotkey of macro in active mode (insert or overstrike mode).I suggest for inserting
(
with)
an even more smart code for the macro:This macro inserts first just
(
. If next character is a carriage return (decimal value 13) or a line-feed (decimal value 10) or the caret is at end of file, additionally)
is inserted and caret is positioned between the parentheses. In all other cases just(
is inserted into active file.This enhancement makes it possible to modify a condition like
to
without getting temporarily
and
It is annoying to require in such cases to press key DEL to delete inserted, but unwanted
)
after inserting(
somewhere in the middle of a line.