Skip to content

Use document buffer#25

Merged
haacked merged 1 commit intomasterfrom
fixes-21
Jul 24, 2014
Merged

Use document buffer#25
haacked merged 1 commit intomasterfrom
fixes-21

Conversation

@jaredpar
Copy link
Collaborator

An ITextView can have multiple ITextBuffer instances associated with it.
When looking for the main ITextDocument associated with an ITextView it
should always be done through the DocumentBuffer. The previous code was
using ITextView::TextBuffer which is equivalent to the EditBuffer.

The reason this worked in standard files (like a .cs) is that the
EditBuffer and DocumentBuffer are the same value. In razor files the
view is much more complex and the EditBuffer is actually a rather
complicated projection buffer (instance of IProjectionBuffer). Hence it
had no associated document.

closes #21

An ITextView can have multiple ITextBuffer instances associated with it.
When looking for the main ITextDocument associated with an ITextView it
should always be done through the DocumentBuffer.  The previous code was
using ITextView::TextBuffer which is equivalent to the EditBuffer.

The reason this worked in standard files (like a .cs) is that the
EditBuffer and DocumentBuffer are the same value.  In razor files the
view is much more complex and the EditBuffer is actually a rather
complicated projection buffer (instance of IProjectionBuffer).  Hence it
had no associated document.

closes #21
haacked added a commit that referenced this pull request Jul 24, 2014
@haacked haacked merged commit 13163f6 into master Jul 24, 2014
@haacked haacked deleted the fixes-21 branch July 24, 2014 16:10
@haacked
Copy link
Owner

haacked commented Jul 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encouragement does not display in razor files

2 participants