John Leidegren
John Leidegren

Reputation: 61057

How do I edit a text buffer (or selected text) with the Visual Studio 2010 SDK

I want to create a simple extension which modifies text buffers based on a command. No sample, documentation or template that I've found so far explains anything about working with text buffers. Anyone got a clue how to do this?

What I want to end up with is a format selection/document extension for text files, that wrap content around 72 characters per line.

Upvotes: 2

Views: 467

Answers (1)

John Leidegren
John Leidegren

Reputation: 61057

I found this extension together with sample very helpful, and now I have something which works. Though it was very counter intuitive at first, I was trying to get the at the code window while this example instead uses a command filter to fiddle with the text view by extending the editor.

The ITextView interface provides access to the text in the editor, you can access the Buffer through that and make changes that way.

Upvotes: 2

Related Questions