Skip to content
Discussion options

You must be logged in to vote

It sounds like you're missing some attributes on your IWpfTextViewMarginProvider.

If you add the ContentType attribute and the TextViewRole attribute, then you should be able to get your margin to only appear on editors.

[Export(typeof(IWpfTextViewMarginProvider))]
[Name(MyMargin.Name)]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
public class MyMargin : IWpfTextViewMarginProvider {
    // ...
}

There are different types of roles that you can use. You can see the pre-defined roles here: https://docs.microsoft.com/dotnet/api/microsoft.visualstudio.text.editor.predefinedtextviewroles

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nvmkpk
Comment options

Answer selected by nvmkpk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants