IMHO this (and others) would also work well directly in the IDE, but the effort is much greater, as the configuration (enable, color, etc.) would mean a lot of changes. And that's a job for the professionals.
HINT: you can use the standard trigger to test first on single files.
Code: Select all
;/=====================================================================================================================
;|
;| File: IDE_ActivateChangeHistory.pb
;|
;| Purpose : activate the Scintilla Feature Change History.
;|
;| LINK: https://www.scintilla.org/ScintillaDoc.html#ChangeHistory
;|
;| Trigger:
;| · Sourcecode loaded
;| · New Sourcecode created
;|
;| Suggested Options:
;| · Wait until tool quits
;| · Run Hidden
;| · Hide Tool from the Main menu
;|
;\=====================================================================================================================
Define hScintilla
; --- look for Scintilla (inside the IDE) ---
hScintilla = Val(GetEnvironmentVariable("PB_TOOL_Scintilla"))
If Not hScintilla ; if not running by IDE
MessageRequester("Fatal Error", "Failed to retrieve PB_TOOL_Scintilla", #PB_MessageRequester_Error)
End ; bye bye
EndIf
; --- Helper Macros ---
Macro SciCall(Message, wParam=0, lParam=0)
SendMessage_(hScintilla, Message, wParam, lParam)
EndMacro
; --- set marker for change history ....
; solid (full filled) rectangle (looks best)
SciCall(#SCI_MARKERDEFINE, #SC_MARKNUM_HISTORY_MODIFIED, #SC_MARK_LEFTRECT)
SciCall(#SCI_MARKERSETBACK, #SC_MARKNUM_HISTORY_MODIFIED, $008CFF) ; == DarkOrange
; framed rectangle (looks okay)
; SciCall(#SCI_MARKERDEFINE, #SC_MARKNUM_HISTORY_MODIFIED, #SC_MARK_BAR)
; SciCall(#SCI_MARKERSETFORE, #SC_MARKNUM_HISTORY_MODIFIED, $008CFF) ; == DarkOrange
; SciCall(#SCI_MARKERDEFINE, #SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, 0)
; SciCall(#SCI_MARKERSETBACK, #SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN, $f0f0f0) ; == DarkOrange
; don't show the saved marker
SciCall(#SCI_MARKERDEFINE, #SC_MARKNUM_HISTORY_SAVED, #SC_MARK_EMPTY)
; --- set all on
; SciCall(#SCI_SETCHANGEHISTORY, #SC_CHANGE_HISTORY_ENABLED | #SC_CHANGE_HISTORY_MARKERS | #SC_CHANGE_HISTORY_INDICATORS)
; set marker only
SciCall(#SCI_SETCHANGEHISTORY, #SC_CHANGE_HISTORY_ENABLED | #SC_CHANGE_HISTORY_MARKERS)
; ; this commands reset the history (PB-IDE is doing this after saving)
;
; SciCall(#SCI_SETUNDOCOLLECTION, 1) ; activate undo buffer
; SciCall(#SCI_EMPTYUNDOBUFFER) ;
; SciCall(#SCI_SETSAVEPOINT) ; at this point the doc is unmodified