codeintel: update custom event to work without the window scope

(integrated from trunk branch change ae58c30 by Todd Whiteman <toddw@activestate.com>)