views:

18

answers:

1

I am trying to write an extension that can access the TextUndoHistory of an VS editor.

Do I have to implement ITextUndoHistory and ITextUndoTransaction myself or is there something that I can hook into using the SDK?

Thanks, Nick

+1  A: 

You import an ITextUndoHistoryRegistry from an [Export]ed MEF component, and call TryGetHistory to retrieve the history for a given buffer. See MarginFactory.cs from my FixMixedTabs extension for an example (in that same extension, InformationBar.cs shows you how to create transactions on the undo history).

Noah Richards
Thanks, I have yet another question, but will create a new post for that...
Nick U