First, I have not really understood what is your problem. But today I have looked on your problem once again and I think, I have gotten it now with comparing the behavior on entering this condition in a PHP file key by key.
So I try to explain what was changed regarding brace auto-completion and what are the differences between UES v16.10 and v16.20.
Brace auto-completion was introduced with UltraEdit for Windows v23.20 which was available before just in UEStudio using IntelliTips feature of UEStudio.
That's why the following settings were removed from
Advanced - Settings or Configuration - IDE - IntelliTips - Miscellaneous in UEStudio v16.20:
- Insert ")]" automatically after "[("
- Insert "}" automatically after "{"
- Smart placement of "}" when inserted automatically
Brace auto-completion can be configured since UES v16.20 at
Advanced - Settings or Configuration - Editor - Braces / strings like in UltraEdit v23.20 and later versions.
Also the configuration settings
Enable auto-brace matching and
Brace match in comments moved from
Editor Display - Brace Matching to
Editor - Braces / strings.
Brace auto-completion and
auto-brace matching are by default enabled in configuration.
How both features work in UE v23.20+ and UES v16.20+?
I use
| as indicator for blinking caret and format matching braces with blue color. The list below is what is shown on pressing a key on keyboard.
i
|
if
|
if
|
if
|
if
(|)
It can be seen that on pressing key for inserting opening parenthesis UE/UES insert with enabled
brace auto-completion automatically also closing parenthesis and position the caret between the parentheses. Further it can be seen with enabled
auto-brace matching that the two matching round brackets are displayed with a different foreground and background color.
if
($
|)
if
($a
|)
if
($a
|)
if
($a =
|)
if
($a ==
|)
if
($a ==
|)
if
($a == $
|)
if
($a == $r
|)
if
($a == $ro
|)
if
($a == $row
|)
if ($a == $row
[|])
It can be seen that on pressing key for inserting opening square bracket UE/UES insert with enabled
brace auto-completion automatically also closing square bracket and position the caret between the square brackets. Further it can be seen with enabled
auto-brace matching that the two matching square brackets are displayed with a different foreground and background color instead of the round brackets.
if ($a == $row["
|])
A string starts here now. In a new *.php file not containing anything else UE/UES can't find a matching double quote and therefore interprets everything up to end of file (closing parenthesis) as string which results in no highlighting anymore of matching braces.
Interesting: The configuration setting
Enable string auto-completion is enabled, but no second double quote is inserted here. That is most likely a bug which I have reported after having finished writing this post.
String auto-completion works in comments and in plain text as well as in PHP file when caret is not within matching braces, but does not work here in this use case with caret being between the matching square brackets (or within matching round brackets).
if ($a == $row["c
|])
if ($a == $row["co
|])
if ($a == $row["col
|])
if ($a == $row
["col"
|])
A string terminating double quote is present now in the file which results in
auto-brace matching becomes active again and highlights the two matching square brackets.
The next key press should be key END because the condition is already completely entered.
But let us assume typing is nevertheless continued with pressing key for closing square bracket.
if ($a == $row
["col"
]|)
UE/UES recognized that the matching square bracket is already present and therefore did not insert another square bracket.
But
auto-brace matching still highlights the square brackets although caret is already after the square brackets.
So whatever is typed next, it is inserted between closing square bracket and closing round bracket. Therefore pressing now key for closing parenthesis results in inserting one more
) which of course is not wanted. It would be required to press key RIGHT ARROW to move caret after already present closing round bracket.
How both features work in UES v16.10 and former versions?
For a comparison the same keys are pressed to enter the same condition with using IntelliTips feature for
auto-brace matching.
i
|
if
|
if
|
if
|
if
(|)
if
($
|)
if
($a
|)
if
($a
|)
if
($a =
|)
if
($a ==
|)
if
($a ==
|)
if
($a == $
|)
if
($a == $r
|)
if
($a == $ro
|)
if
($a == $row
|)
No difference up to now in comparison to UES v16.20.
if
($a == $row[
|]
)
It can be seen here that
auto-brace matching worked different in UES v16.10 in comparison to v16.20. After inserting both square brackets and placing the caret between, the round brackets are still highlighted and not the square brackets.
if ($a == $row
["
|"
])
After pressing the key for inserting a double quote one more double quote is inserted automatically by UEStudio and caret is placed between. The
auto-brace matching feature highlights now the square brackets.
if ($a == $row["c
|"])
if ($a == $row["co
|"])
if ($a == $row["col
|"])
The next key press should be key END because the condition is already completely entered.
But let us assume typing is nevertheless continued with pressing key for double quote, closing square bracket, closing parenthesis.
if ($a == $row["col"
|])
if ($a == $row["col"]
|)
if ($a == $row["col"])
|
Conclusion:
The IntelliTips based
brace auto-completion of UES v16.10 and former versions was indeed better than the general
brace auto-completion introduced with UE v23.20 and superseding in UES v16.20 the IntelliTips based
brace auto-completion.
My suggestion for the moment until a new version of UE and UES with an improved
brace auto-completion is released:
Uncheck setting
Enable brace auto-completion at
Advanced - Settings or Configuration - Editor - Braces / strings when not really making use of it because of typing closing brackets already present in the file because of enabled
brace auto-completion.