Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / August 2005

Tip: Looking for answers? Try searching our database.

Removing yellow edit marker

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David O'Brien - 05 Aug 2005 16:20 GMT
I am opening a new editor view to display formatted code.  The contents are
not read from a file.  I create the view by calling
_DTE.ItemOperations.NewFile.  I then insert the text into the view in one of
two ways: creating a TextSelection from the ActiveDocument, or updating the
IVsTextLines of the active view.  In either case, the whole view has the
yellow line down the left side showing that it is all editted.  This
essentially is true since I've added text to a new empty file.

I realize that I could first dump the contents I want to display to a file
and then just open the file, but I'd rather not write to disk and then have
to erase it.  Is there a better way to display code is an editor view (just
like opening a real file) or, better yet, is there a way to block/remove the
yellow line once I display the text/code as I do now?

Thank you,

-DOB-
"Ed Dore [MSFT]" - 05 Aug 2005 18:05 GMT
Hi Dave,

There are actually a few ways to deal with this, provided you are using
Whidbey Beta 2 (or later). There is a new interface called IVsTextBufferEx
defined in TEXTMGR2.IDL which you can use to suppress the tracking.
Specifically, IVsTextBufferEx::SetTrackChangesSuppression.

Alternatively, you should initialize your VsTextBuffer object by calling
IVsTextBuffer::InitializeContent(). The change tracking doesn't kick in
until after this is called. If you add text manually (or programatically)
by some other means, those yellow and green margins will appear. But if you
set the initial text in that InitializeContent call, then the initial text
will not be marked as changed text.

If you want to loose the feature altogether, you can also use
IVsCodeWindowEx::Initialize() and use the VIF_SUPPRESSTRACKCHANGES flag.
This is also defined in the TEXTMGR2.IDL file.

The interfaces and flags also appear to be defined in the
Microsoft.VisualStudio.TextManager.Interop.8.0. assembly as well. So you
should be able to do this from managed packages as well.

Sincerely,
Ed Dore [MSFT]

This post is 'AS IS' with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.