Exemplo n.º 1
0
        public void ReplWindowCreated(IReplWindow window)
        {
            var textViewAdapter = _adapterFact.GetViewAdapter(window.TextView);

            BraceMatcher.WatchBraceHighlights(window.TextView, PythonToolsPackage.ComponentModel);

            new EditFilter(window.TextView, textViewAdapter, _editorOpsFactory.GetEditorOperations(window.TextView));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts watching the provided text view for brace matching.  When new braces are inserted
        /// in the text or when the cursor moves to a brace the matching braces are highlighted.
        /// </summary>
        public static void WatchBraceHighlights(ITextView view, IComponentModel componentModel)
        {
            var matcher = new BraceMatcher(view, componentModel);

            // position changed only fires when the caret is explicitly moved, not from normal text edits,
            // so we track both changes and position changed.
            view.Caret.PositionChanged += matcher.CaretPositionChanged;
            view.TextBuffer.Changed    += matcher.TextBufferChanged;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Starts watching the provided text view for brace matching.  When new braces are inserted
        /// in the text or when the cursor moves to a brace the matching braces are highlighted.
        /// </summary>
        public static void WatchBraceHighlights(ITextView view, IComponentModel componentModel) {
            var matcher = new BraceMatcher(view, componentModel);

            // position changed only fires when the caret is explicitly moved, not from normal text edits,
            // so we track both changes and position changed.
            view.Caret.PositionChanged += matcher.CaretPositionChanged;
            view.TextBuffer.Changed += matcher.TextBufferChanged;
            view.Closed += matcher.TextViewClosed;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Starts watching the provided text view for brace matching.  When new braces are inserted
        /// in the text or when the cursor moves to a brace the matching braces are highlighted.
        /// </summary>
        public static void WatchBraceHighlights(PythonEditorServices editorServices, ITextView view)
        {
            var matcher = new BraceMatcher(editorServices, view);

            // position changed only fires when the caret is explicitly moved, not from normal text edits,
            // so we track both changes and position changed.
            view.Caret.PositionChanged += matcher.CaretPositionChanged;
            view.TextBuffer.Changed    += matcher.TextBufferChanged;
            view.Closed += matcher.TextViewClosed;
        }