From 5c69af0777b92c26388feb962c45b49fbaa26210 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 23 Dec 2019 11:37:36 +0100 Subject: [PATCH] If you use the PROPERTY ... USE syntax, you have to use the SHIFT key with the ENTER key to automatically insert property handlers. [DEVELOPMENT ENVIRONMENT] * NEW: If you use the PROPERTY ... USE syntax, you have to use the SHIFT key with the ENTER key to automatically insert property handlers. --- .../gambas3/.src/Editor/Code/FEditor.class | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/app/src/gambas3/.src/Editor/Code/FEditor.class b/app/src/gambas3/.src/Editor/Code/FEditor.class index 5bd783672..de0a60ca6 100644 --- a/app/src/gambas3/.src/Editor/Code/FEditor.class +++ b/app/src/gambas3/.src/Editor/Code/FEditor.class @@ -548,7 +548,7 @@ Public Sub mnuClose_Click() End -Private Sub InsertProperty() +Private Sub InsertProperty(bShift As Boolean) Dim iPos As Integer Dim bStatic As Boolean @@ -558,28 +558,31 @@ Private Sub InsertProperty() Dim sType As String Dim iLine As Integer Dim iCol As Integer + Dim aSymbols As String[] - If Highlight.Symbols[0] = "STATIC" Then + aSymbols = Highlight.Symbols + + If aSymbols[0] = "STATIC" Then bStatic = True iPos = 2 Else iPos = 1 Endif - If Highlight.Symbols[iPos] = "READ" Then + If aSymbols[iPos] = "READ" Then bRead = True Inc iPos Endif ANOTHER_SYMBOL: - sName = Highlight.Symbols[iPos] + sName = aSymbols[iPos] If sName = "{" Then Inc iPos If Highlight.Types[iPos] <> Highlight.Symbol Then Return - sName = Highlight.Symbols[iPos] + sName = aSymbols[iPos] Inc iPos - If Highlight.Symbols[iPos] <> "}" Then Return + If aSymbols[iPos] <> "}" Then Return Else If Highlight.Types[iPos] <> Highlight.Symbol Then Return Endif @@ -587,23 +590,27 @@ ANOTHER_SYMBOL: Inc iPos - If Highlight.Symbols[iPos] = "," Then + If aSymbols[iPos] = "," Then Inc iPos Goto ANOTHER_SYMBOL Endif sName = sName2 - If Highlight.Symbols[iPos] <> "AS" Then Return + If aSymbols[iPos] <> "AS" Then Return Inc iPos - sType = Highlight.Symbols[iPos] + sType = aSymbols[iPos] If Highlight.Types[iPos] <> Highlight.DataType Then Return Inc iPos - If Highlight.Symbols.Max >= iPos Then - If Highlight.Symbols[iPos] = "[" Then + If aSymbols.Max >= iPos Then + If aSymbols[iPos] = "[" Then sType &= "[]" Endif Endif + + If aSymbols[aSymbols.Max - 1] = "USE" Then + If Not bShift Then Return + Endif iLine = $hEditor.Line iCol = $hEditor.Column @@ -903,7 +910,7 @@ Public Sub Editors_KeyPress() If aSymbol.Count >= 4 Then If aSymbol[0] = "PROPERTY" Or If aSymbol[0] = "STATIC" And aSymbol[1] = "PROPERTY" Then - InsertProperty + InsertProperty(Key.Shift) '$hEditor.Insert("\n") 'Stop Event Return