Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use document buffer #25

Merged
merged 1 commit into from
Jul 24, 2014
Merged

Use document buffer #25

merged 1 commit into from
Jul 24, 2014

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