I made this slight change to AddKeywords to speed it up when changing styling. It could probably be applied to all procs that call RestyleLines. It is backwards compatible.
(See the argument restyle.i = #True and the test for it when calling RestyleLinesXXX).
Code:
;/////////////////////////////////////////////////////////////////////////////////
;The following function records a list of keywords to use the style specified. The list of words are to be separated by space characters.
;Note that only Ascii characters must be used within each keyword.
;Duplicates are simply replaced.
;Set keywordFlags to one (or more) of the keyword flags #GOSCI_OPENFOLDKEYWORD, #GOSCI_CLOSEFOLDKEYWORD or GOSCI_ADDTOCODECOMPLETION ... etc.
Procedure GOSCI_AddKeywords(id, keyWords$, styleIndex=#STYLE_DEFAULT, keywordflags=0, blnSortKeywords=#False, restyle.i = #True)
Protected *this._GoScintilla, t1
If GOSCI_AddKeywordsXXX(id, keyWords$, styleIndex, keywordFlags)
*this = GetGadgetData(id)
If *this
If blnSortKeywords
If *this\flags & #GOSCI_KEYWORDSCASESENSITIVE = 0
t1 = #PB_Sort_NoCase
EndIf
SortStructuredList(*this\Keywords(), #PB_Sort_Ascending|t1, OffsetOf(GoScintillaKeyword\keyWord$), #PB_Sort_String)
EndIf
EndIf
If restyle = #True
GOSCI_RestyleLinesXXX(ID, 0, -1)
EndIf
EndIf
EndProcedure
;/////////////////////////////////////////////////////////////////////////////////