diff --git a/app/src/gambas3/.src/Editor/Code/MPrettyCode.module b/app/src/gambas3/.src/Editor/Code/MPrettyCode.module index 1afd10b9c..8a0e44e4e 100644 --- a/app/src/gambas3/.src/Editor/Code/MPrettyCode.module +++ b/app/src/gambas3/.src/Editor/Code/MPrettyCode.module @@ -110,6 +110,7 @@ Public Sub Run(hModule As Object) $aSwitch = New Integer[] aText = Split(hEditor.Text, "\n") + iEnd = Min(aText.Max, iEnd) X = hEditor.Column Y = hEditor.Line diff --git a/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.class b/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.class index 15b11b36c..cada90a3d 100644 --- a/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.class +++ b/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.class @@ -675,6 +675,7 @@ Public Sub btnRunQuery_Click() Dim sReq As String = Trim(edtRequest.Text) Dim iPos As Integer Dim sStart As String + Dim fTimer As Float While Left(sReq, 2) = "/*" iPos = InStr(sReq, "*/") @@ -684,6 +685,8 @@ Public Sub btnRunQuery_Click() If Not sReq Then Return + fTimer = Timer + Inc Application.Busy iPos = InStr(sReq, " ") @@ -701,7 +704,11 @@ Public Sub btnRunQuery_Click() Dec Application.Busy - If Error Then Balloon.Error(("Unable to run query.") & "\n\n" & Error.Text, btnRunQuery) + If Error Then + Balloon.Error(("Unable to run query.") & "\n\n" & Error.Text, btnRunQuery) + Else + edtRequest.ShowMessageLabel(Subst(("&1 s"), Format(Timer - fTimer, "0.###")), Highlight.Highlight, True) + Endif End diff --git a/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.form b/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.form index fa2462b83..227f7e83c 100644 --- a/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.form +++ b/app/src/gambas3/.src/Editor/Connection/FConnectionEditor.form @@ -109,7 +109,7 @@ MoveScaled(1,1,106,72) Expand = True { panTable Panel - MoveScaled(2,2,71,35) + MoveScaled(2,2,89,35) Arrangement = Arrange.Fill Spacing = True { tabTable TabPanel @@ -230,11 +230,11 @@ Index = 0 } { panRequest VBox - MoveScaled(6,8,61,24) + MoveScaled(6,9,80,24) Visible = False Background = Color.Background { tlbData2 ToolBar - MoveScaled(0,0,57,4) + MoveScaled(0,0,75,4) Separator = True { btnRunQuery ToolButton MoveScaled(0,0,12,4) @@ -291,6 +291,9 @@ ToolTip = ("Redo") Picture = Picture["icon:/small/redo"] } + { Spring1 Spring + MoveScaled(58,1,5,2) + } } { tabRequest TabPanel MoveScaled(3,5,33,7) @@ -304,6 +307,8 @@ Expand = True Border = False Highlight = "SQL" + Mode = "SQL" + Wrap = True } } } diff --git a/app/src/gambas3/.src/Editor/MCompressFile.module b/app/src/gambas3/.src/Editor/MCompressFile.module index eaa6be336..1046ec956 100644 --- a/app/src/gambas3/.src/Editor/MCompressFile.module +++ b/app/src/gambas3/.src/Editor/MCompressFile.module @@ -2,7 +2,8 @@ Private Const IDENT_CAR As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$" Private Const IDENT_CAR_CSS As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-.#" -Private Const SUBST_CAR As String = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +Private Const SUBST_CAR_FIRST As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +Private Const SUBST_CAR As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" Private $aExt As String[] = ["js", "css", "html"] @@ -74,18 +75,22 @@ Private Sub SubstIdent(sIdent As String) If $iDoNotCompress Then Return If $cSubst.Exist(sIdent) Then Return - Repeat + Do Inc $iSubst iIndex = $iSubst sSubst = "" - Repeat - sSubst = Mid$(SUBST_CAR, 1 + iIndex Mod Len(SUBST_CAR), 1) & sSubst + sSubst = Mid$(SUBST_CAR_FIRST, 1 + iIndex Mod Len(SUBST_CAR_FIRST), 1) + iIndex \= Len(SUBST_CAR_FIRST) + While iIndex + sSubst &= Mid$(SUBST_CAR, 1 + iIndex Mod Len(SUBST_CAR), 1) '& sSubst iIndex \= Len(SUBST_CAR) - Until iIndex = 0 + Wend - Until Not $cIdent.Exist(sSubst) + If Not $cIdent.Exist(sSubst) And If Not $cKeyword.Exist(sSubst) Then Break + + Loop $cSubst[sIdent] = sSubst @@ -349,7 +354,9 @@ Public Sub Javascript(sText As String) As String Continue Endif Endif + sCar = " " + If InStr("=", Right(sCar2)) = 0 And If sLastKeyword <> "return" Then If (Len(sRes) - iLastNewLine) > 76 Or If Mid$(sText, iPos + 1) Begins "function " Then sRes &= "\n" @@ -359,6 +366,8 @@ Public Sub Javascript(sText As String) As String If Right(sRes) = "}" And If IsLetter(Right(sCar2)) Then sCar = "\n" iLastNewLine = Len(sRes) + 1 + Else If InStr("+-*/=", Right(sRes)) And If Right(sRes) = Right(sCar2) Then + ' keep the space Else If InStr(IDENT_CAR, Right(sRes)) = 0 And If Right(sRes) <> "}" Then Continue If InStr(IDENT_CAR, Right$(sCar2)) = 0 Then Continue diff --git a/app/src/gambas3/.src/VersionControl/FVersionControl.form b/app/src/gambas3/.src/VersionControl/FVersionControl.form index c6d07f22f..c420420ab 100644 --- a/app/src/gambas3/.src/VersionControl/FVersionControl.form +++ b/app/src/gambas3/.src/VersionControl/FVersionControl.form @@ -25,6 +25,7 @@ Border = False Highlight = "Diff" ReadOnly = True + Wrap = True } Index = 2 Text = ("Terminal")