Document Events
event AppShutdown()
Called just before the Source Insight application exits.
event AppCommand(sCommand)
Called just after the given user-level command has executed.
Document Events
Document events apply to when file buffers are opened, closed, saved, or modified.
event DocumentNew(sFile)
Called just after the given file buffer is created. The file name is sFile
.
event DocumentOpen(sFile)
Called just after the file buffer is opened. The file name is sFile
.
event DocumentClose(sFile)
Called just after the file buffer is closed. The file name is sFile
.
event DocumentSave(sFile)
Called just before the file buffer is saved. The file name is sFile
. You can make edits to the file buffer at this point just before it gets saved. If you want to do something after the file is saved, then you can use the
DocumentSaveComplete
event.
event DocumentSaveComplete(sFile)
Called just after the file buffer is saved. The file name is sFile
. If you want to get control before the file is saved, then you can use the
DocumentSave
event.
event DocumentChanged(sFile)
Called when the file buffer is edited by the user. The file name is sFile
. This event is handled asynchronously. That is, it is not called as the user is typing. It is called after a moment of idleness. This allows you edit the file inside this event handler. Note because this function is called asynchronously, it is possible the sFile file may not be open, so you need to test the return value of
GetBufHandle(sFile)
to make sure it is not hNil
.
event DocumentSelectionChanged(sFile)
Called when the user selects text, or moves the cursor in the current file. The file name is sFile
. This event is handled asynchronously. That is, it is not called as the user moves the cursor. It is called after a moment of idleness. Note because this function is called asynchronously, it is possible the sFile
file may not be open, so you need to test the return value of
GetBufHandle(sFile)
to make sure it is not hNil
.
414 Source Insight 4 User Guide