Bug? Editor brakets () start - end

George Anifantakis

Member
Licensed User
Longtime User
Perhaps there is a bug in the editor wher using )( brackets.

In the below example you can't place the cursor at the ^ position as it imedietly goes to the next ( bracket.

Dim ff As String = Regex.Split(":" ,Main.wini.get("wKey1"))(0)
^
 

George Anifantakis

Member
Licensed User
Longtime User
If you put the cursor on the red bracket the editor shows correctly the starting bracket. I you press the right arrow key after the red arrow instead the cursor to move to the green bracket it moves to the blue one. If you place a space between the green and the blue one the it's working correctly.

Example
Regex.Split(":" , wini.get("wKey1"))(0)


B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Dim wini As Map
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    Dim ff As String = Regex.Split(":" , wini.get("wKey1"))(0)
End Sub

Sub Activity_Resume
   
End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
 

James Chamblin

Active Member
Licensed User
Longtime User
I see the problem here. To help identify exactly where the cursor is, press Ins to enable overwrite mode. Now put the cursor on top of the ) after "wKey1" (the red bracket) and you will see that the corresponding bracket is not highlighted. Next, move right to the green one, and the previous one is highlighted, not the green one. Now move to the blue one, and the correct pair is highlighted.
brackethighlight.png

Seems when the cursor is on a closing bracket, the IDE looks behind the cursor and highlights the previous pair if one exists. When the cursor is on an opening bracket, the correct pair is highlighted.
 
Top