[DEVELOPMENT ENVIRONMENT]

* NEW: Add an indentation level for .Begin/.End functions in the automatic code formater.


git-svn-id: svn://localhost/gambas/trunk@7654 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Fabien Bodard 2016-03-21 08:22:40 +00:00
parent 3fbcee5fa6
commit 7233dba468

View File

@ -210,10 +210,10 @@ Private Sub IndentLine(sLine As String) As String
Dim sAdd As String
Dim iNextLevel As Integer
Dim sSym As String
Dim sFuncSym As String
Dim iPos As Integer
Dim iType As Integer
Dim bLastWrap As Boolean
sLine = LTrim(sLine)
If sLine Then
@ -263,6 +263,8 @@ Private Sub IndentLine(sLine As String) As String
$bNeedNewLine = True
Else
sSym = aSym[0]
If aSym.Count > 2 Then sFuncSym = LCase(aSym[2])
If sSym = "END" And If aSym.Count >= 2 Then sSym &= " " & aSym[1]
If sSym = "DIM" Then
@ -290,6 +292,14 @@ Private Sub IndentLine(sLine As String) As String
Else If sSym = "SELECT" Then
$iLastSelect = $iLine
iNextLevel = $iLevel + 2
Else If sFuncSym = "end" Then 'Fabien : Add End function detecetion
Dec $iLevel
iNextLevel = $iLevel
If bLastWrap Then Inc $iLevel
Else If sFuncSym = "begin" Then 'Fabien : Add Begin function detection
iNextLevel = $iLevel
Inc iNextLevel
If bLastWrap Then Inc $iLevel
Else
If $cClose.Exist(sSym) Then Dec $iLevel
iNextLevel = $iLevel