Re: Intercepting and modifying calltips on the fly

Tim Rude <[email protected]> Fri, 21 Apr 2023 15:12:15 -0700 (PDT)
Newsgroups gmane.editors.scite.general
Message-ID <[email protected]>

 A start may be too specify how it could work.


Neil:

The SciTE Lua Scripting Extension doc links to the SciTE Extension 
Interface doc which describes a number of event functions (OnOpen, OnClose, 
OnSwitchFile, OnSave, OnBeforeSave, OnChar, OnKey, OnSavePointReached, 
OnSavePointLeft, OnDwellStart, OnDoubleClick, OnMarginClick, OnUpdateUI, 
and OnUserListSelection) and how they can be utilized. I'm thinking that if 
an event function was added such as 'OnCallTipShow' that fired just before 
a CallTip was auto-displayed, and passed as parameters the same (position 
pos, string definition) values as one would pass to the CallTipShow 
function, then a custom OnCallTipShow function could be written to modify 
the 'string definition' value as desired, call the actual CallTipShow 
function using the original 'position pos' parameter and the modified 
'string definition' parameter, and then return True from the custom 
OnCallTipShow event function to signal to SciTE that it doesn't need to 
proceed with the rest of the event (displaying the calltip) because it's 
already been handled.

The OnCallTipShow event function should only be called when SciTE is just 
about to *automatically* display a calltip, but not when the CallTipShow 
function is manually called, to prevent a recursive loop.

If there is no OnCallTipShow event function coded, then SciTE would just 
proceed normally with displaying the calltip as usual.

Admittedly, I'm not versed in LUA programming, but based on the existing 
functionality in the SciTE Extension Interface, this would seem a logical 
way to do this.

Tim Rude

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/85c2813c-ca2d-4b16-bba2-fc09b8d92af9n%40googlegroups.com.