Code: Select all
EnableExplicit
#SetCursor = #True
Define IDEGadgetID.i, SavedClipboardText$, IDEText$
CompilerIf #SetCursor
Define StartPos.l
CompilerEndIf
IDEGadgetID = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
If IDEGadgetID
CompilerIf #SetCursor
StartPos = SendMessage_(IDEGadgetID, #SCI_GETSELECTIONSTART, #Null, #Null)
CompilerEndIf
SavedClipboardText$ = GetClipboardText()
SetClipboardText("")
SendMessage_(IDEGadgetID, #SCI_COPY, #Null, #Null)
IDEText$ = GetClipboardText()
If IDEText$ <> ""
SetClipboardText(";{ " + #LF$ + IDEText$ + #LF$ + ";}")
SendMessage_(IDEGadgetID, #SCI_PASTE, #Null, #Null)
CompilerIf #SetCursor
StartPos + 3
SendMessage_(IDEGadgetID, #SCI_GOTOPOS, StartPos, #Null)
CompilerEndIf
EndIf
SetClipboardText(SavedClipboardText$)
EndIf
Compile it to an Exe and add it to the Tools.
I'm not 100% sure about the #LF$ maybe it should be a #CRLF$, but it looks that it works.