Hi Xinen,
If you look at our AdornmentsIntraTextNotes, that currently is doing document tagging. To make it view-based tagging instead, you do these things...
1) Change the IntraTextNoteTagger to a view-based tagger with this contructor:
public IntraTextNoteTagger(IEditorView view) : base("IntraTextNoteTagger", null, (view != null ? view.SyntaxEditor.Document : null), true) {}
2) Change the language to register a view-based tagger provider instead:
this.RegisterService(new TextViewTaggerProvider<IntraTextNoteTagger>(typeof(IntraTextNoteTagger)));
3) Change the MainControl.OnAddNoteButtonClick handler's 'if' statement to be:
if (editor.ActiveView.Properties.TryGetValue(typeof(IntraTextNoteTagger), out tagger)) {
If you do those things, it will be view-based.