Exemple #1
0
        protected override void OnInvoke(object sender, EventArgs e)
        {
            base.OnInvoke(sender, e);
            ITextView view = TextEditor.GetCurrentView();

            if (view == null)
            {
                return;
            }
            ITextCaret caret = view.Caret;

            if (caret == null)
            {
                return;
            }

            var point = TextEditor.MapCaretToPrimaryBuffer(view);

            //SnapshotPoint? point = caret.Position.BufferPosition;
            if (point != null)
            {
                IUserOutlining outlining =
                    OutliningManager.Get(point.Value.Snapshot.TextBuffer);
                outlining.RemoveAt(point.Value);
            }
        }
            private void RemoveOutlineAt(SnapshotPoint snapshotPoint)
            {
                var            textBuffer = this.theHost.TextView.TextBuffer;
                IUserOutlining outlining  = UserOutliningManager.Get(textBuffer);

                if (outlining != null)
                {
                    outlining.RemoveAt(snapshotPoint);
                }
            }
Exemple #3
0
        public bool Handle(ITextView view)
        {
            ITextCaret caret = view.Caret;

            if (caret == null)
            {
                return(false);
            }

            var point = TextEditor.MapCaretToPrimaryBuffer(view);

            //SnapshotPoint? point = caret.Position.BufferPosition;
            if (point != null)
            {
                IUserOutlining outlining =
                    UserOutliningManager.Get(point.Value.Snapshot.TextBuffer);
                outlining.RemoveAt(point.Value);
                Telemetry.WriteEvent("Remove Outlining");
            }
            return(true);
        }