mirror of
https://github.com/coteditor/CotEditor.git
synced 2024-09-11 11:25:57 +03:00
Fix unwanted syntax highligt progress for finished operation
This commit is contained in:
parent
fcdb37b625
commit
a881d42a97
@ -2,6 +2,15 @@
|
||||
Change Log
|
||||
==========================
|
||||
|
||||
3.2.5
|
||||
--------------------------
|
||||
|
||||
### Fixes
|
||||
|
||||
- Fix an issue where the syntax highlighting indicator could display twice.
|
||||
|
||||
|
||||
|
||||
3.2.4 (207)
|
||||
--------------------------
|
||||
|
||||
|
@ -445,13 +445,15 @@ extension SyntaxStyle {
|
||||
if let storage = self.textStorage, self.shouldShowIndicator(for: highlightRange.length) {
|
||||
// wait for window becomes ready
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
while storage.layoutManagers.isEmpty && (!operation.isFinished || !operation.isCancelled) {
|
||||
while storage.layoutManagers.isEmpty {
|
||||
if operation.isFinished || operation.isCancelled { return }
|
||||
|
||||
usleep(100)
|
||||
}
|
||||
|
||||
// attach the indicator as a sheet
|
||||
DispatchQueue.main.sync {
|
||||
guard !operation.isFinished || !operation.isCancelled,
|
||||
guard !operation.isFinished, !operation.isCancelled,
|
||||
let contentViewController = storage.layoutManagers.first?.firstTextView?.viewControllerForSheet
|
||||
else { return }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user