From 35d20604b1e54b00aa7958513edb541a6be91cc3 Mon Sep 17 00:00:00 2001 From: gambas Date: Sat, 29 Sep 2018 04:42:42 +0200 Subject: [PATCH] TextEditor: Try to make automatic insertion of quotes more clever. [GB.FORM.EDITOR] * NEW: TextEditor: Try to make automatic insertion of quotes more clever. --- .../.src/TextEditorMode_Gambas.class | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/comp/src/gb.form.editor/.src/TextEditorMode_Gambas.class b/comp/src/gb.form.editor/.src/TextEditorMode_Gambas.class index efba3aefe..0889043c0 100644 --- a/comp/src/gb.form.editor/.src/TextEditorMode_Gambas.class +++ b/comp/src/gb.form.editor/.src/TextEditorMode_Gambas.class @@ -49,41 +49,41 @@ Private Sub ToggleAroundCurrentWord(hEditor As TextEditor, sBraces As String) End -Public Sub InsideString(hEditor As TextEditor) As Boolean - - Dim iLen As Integer - Dim I As Integer - Dim sInside As String - Dim sLine As String - Dim sCar As String - - sLine = hEditor.Current.Text - iLen = hEditor.Current.Length - - Me.InsideStringEscape = False - Me.InsideStringDelim = "" - - For I = 1 To hEditor.Column - sCar = String.Mid$(sLine, I, 1) - If sCar = sInside Then - sInside = "" - Else If InStr("'\"", sCar) Then - If Not sInside Then - sInside = sCar - If sCar = "'" Then Return True - Endif - Else If sCar = "\\" Then - If sInside Then - Inc I - Me.InsideStringEscape = I > hEditor.Column - Endif - Endif - Next - - Me.InsideStringDelim = sInside - Return sInside - -End +' Public Sub InsideString(hEditor As TextEditor) As Boolean +' +' Dim iLen As Integer +' Dim I As Integer +' Dim sInside As String +' Dim sLine As String +' Dim sCar As String +' +' sLine = hEditor.Current.Text +' iLen = hEditor.Current.Length +' +' Me.InsideStringEscape = False +' Me.InsideStringDelim = "" +' +' For I = 1 To hEditor.Column +' sCar = String.Mid$(sLine, I, 1) +' If sCar = sInside Then +' sInside = "" +' Else If InStr("'\"", sCar) Then +' If Not sInside Then +' sInside = sCar +' If sCar = "'" Then Return True +' Endif +' Else If sCar = "\\" Then +' If sInside Then +' Inc I +' Me.InsideStringEscape = I > hEditor.Column +' Endif +' Endif +' Next +' +' Me.InsideStringDelim = sInside +' Return sInside +' +' End Public Sub OnKeyPress(hEditor As TextEditor) As Boolean