c# - From a VS2008 VSPackage, how do I get notified whenever caret position changed? -
i'd notified whenever caret position changed in active text view. thing envdte seems offer the linechanged event, of-course not raised when moving caret left or right within same line.
i realize vs2010's editor extensibility lets no sweat, need solution backwards compatible vs2008.
have seen this: dte2 events don't fire
you have keep local instance of events object, otherwise event wont fire (i assume because com backed events object went out of scope , gc'd):
public class myvspackage { texteditorevents _texteditorevents; public myvspackage() { _texteditorevents = dte.events.texteditorevents; _texteditorevents.linechanged += (point, endpoint, hint) => //do here } }
Comments
Post a Comment