Skip to content

Commit e216798

Browse files
committed
Refactor SyntaxOutlineEditView
1 parent 99f44a4 commit e216798

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

CotEditor/Sources/Settings Window/Syntax Editor/SyntaxOutlineEditView.swift

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,12 @@ struct SyntaxOutlineEditView: View {
6262
}
6363
.tag(Optional<Syntax.Outline.Kind>.none)
6464

65-
Section {
66-
ForEach(Syntax.Outline.Kind.iconCases, id: \.self) { kind in
67-
Label {
68-
Text(kind.label)
69-
} icon: {
70-
kind.icon(mode: .palette) // workaround
71-
}
72-
.tag(Optional(kind))
73-
}
74-
}
65+
Divider()
7566

76-
Section {
77-
let kind = Syntax.Outline.Kind.separator
67+
ForEach(Syntax.Outline.Kind.allCases, id: \.self) { kind in
68+
if kind == .separator {
69+
Divider()
70+
}
7871
Label {
7972
Text(kind.label)
8073
} icon: {

Packages/Syntax/Sources/Syntax/Syntax.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,8 @@ public struct Syntax: Equatable, Sendable {
9494

9595
case separator
9696

97-
public static let levelRange = 1...9
9897

99-
public static let iconCases: [Self] = Self.allCases.dropLast()
98+
public static let levelRange = 1...7
10099
}
101100

102101

0 commit comments

Comments
 (0)