public TextMateDocumentIndentEngine(TextEditor editor)
        {
            this.editor = editor;
            var startScope = editor.SyntaxHighlighting.GetScopeStackAsync(0, CancellationToken.None).WaitAndGetResult(CancellationToken.None);
            var lang       = TextMateLanguage.Create(startScope);

            increaseIndentPattern = lang.IncreaseIndentPattern;
            decreaseIndentPattern = lang.DecreaseIndentPattern;
            indentNextLinePattern = lang.IndentNextLinePattern;
            unIndentedLinePattern = lang.UnIndentedLinePattern;
        }
Exemple #2
0
        protected override void Initialize()
        {
            Editor.TextChanged += UpdateFoldings;

            var startScope = Editor.SyntaxHighlighting.GetScopeStackAsync(0, CancellationToken.None).WaitAndGetResult(CancellationToken.None);
            var lang       = TextMateLanguage.Create(startScope);

            foldingStartMarker = lang.FoldingStartMarker;
            foldingStopMarker  = lang.FoldingStopMarker;
            UpdateFoldings(null, null);
        }
Exemple #3
0
 protected override void Initialize()
 {
     Editor.TextChanged += UpdateFoldings;
     try {
         var startScope = Editor.SyntaxHighlighting.GetScopeStackAsync(0, CancellationToken.None).WaitAndGetResult(CancellationToken.None);
         var lang       = TextMateLanguage.Create(startScope);
         foldingStartMarker = lang.FoldingStartMarker;
         foldingStopMarker  = lang.FoldingStopMarker;
         UpdateFoldings(null, null);
     } catch (Exception e) {
         LoggingService.LogError("Error while initializing text mate folding text editor extension.", e);
         Editor.TextChanged -= UpdateFoldings;
     }
 }