mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-10-26 19:10:11 +03:00
Fix auto indent style detection
This commit is contained in:
parent
884e0f4a7d
commit
3b183fa48e
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
develop
|
||||
--------------------------
|
||||
|
||||
### Fixes
|
||||
|
||||
- [beta] Fix an issue where auto indent sytle detection didn't work.
|
||||
|
||||
|
||||
|
||||
3.0.0-beta.3 (146)
|
||||
--------------------------
|
||||
|
||||
|
@ -97,6 +97,18 @@ final class DocumentViewController: NSSplitViewController, SyntaxStyleDelegate,
|
||||
|
||||
(self.statusBarItem?.viewController as? StatusBarController)?.documentAnalyzer = document.analyzer
|
||||
|
||||
document.textStorage.delegate = self
|
||||
document.syntaxStyle.delegate = self
|
||||
|
||||
let editorViewController = self.createEditor(baseViewController: nil)
|
||||
|
||||
// start parcing syntax highlights and outline menu
|
||||
if document.syntaxStyle.canParse {
|
||||
editorViewController.navigationBarController?.showOutlineIndicator()
|
||||
}
|
||||
document.syntaxStyle.invalidateOutline()
|
||||
self.invalidateSyntaxHighlight()
|
||||
|
||||
// detect indent style
|
||||
if Defaults[.detectsIndentStyle],
|
||||
let indentStyle = document.textStorage.string.detectedIndentStyle
|
||||
@ -111,18 +123,6 @@ final class DocumentViewController: NSSplitViewController, SyntaxStyleDelegate,
|
||||
}()
|
||||
}
|
||||
|
||||
document.textStorage.delegate = self
|
||||
document.syntaxStyle.delegate = self
|
||||
|
||||
let editorViewController = self.createEditor(baseViewController: nil)
|
||||
|
||||
// start parcing syntax highlights and outline menu
|
||||
if document.syntaxStyle.canParse {
|
||||
editorViewController.navigationBarController?.showOutlineIndicator()
|
||||
}
|
||||
document.syntaxStyle.invalidateOutline()
|
||||
self.invalidateSyntaxHighlight()
|
||||
|
||||
// focus text view
|
||||
self.view.window?.makeFirstResponder(editorViewController.textView)
|
||||
|
||||
@ -678,6 +678,7 @@ final class DocumentViewController: NSSplitViewController, SyntaxStyleDelegate,
|
||||
textView.font = baseTextView.font
|
||||
textView.theme = baseTextView.theme
|
||||
textView.tabWidth = baseTextView.tabWidth
|
||||
textView.isAutomaticTabExpansionEnabled = baseTextView.isAutomaticTabExpansionEnabled
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(textViewDidChangeSelection),
|
||||
|
Loading…
Reference in New Issue
Block a user