@@ -37,6 +37,7 @@ struct ContentView: View {
37
37
@State var value : String = jsonString
38
38
@State var lineWrapping = false
39
39
@State var lineNumber = true
40
+ @State var foldGutter = false
40
41
@State var readOnly = false
41
42
@State var language : Language = . json
42
43
@State var theme : Themes = . vscodedark
@@ -50,6 +51,7 @@ struct ContentView: View {
50
51
CodeMirror ( value: $value)
51
52
. cmLineNumber ( $lineNumber)
52
53
. cmLineWrapping ( $lineWrapping)
54
+ . cmFoldGutter ( $foldGutter)
53
55
. cmReadOnly ( $readOnly)
54
56
. cmLanguage ( $language)
55
57
. cmTheme ( $theme)
@@ -65,18 +67,28 @@ struct ContentView: View {
65
67
. frame ( maxWidth: . infinity, maxHeight: . infinity)
66
68
. safeAreaInset ( edge: . bottom, spacing: 0 ) {
67
69
HStack {
68
- Toggle ( isOn: $lineNumber, label: { Text ( " Line Number " ) } )
69
- . toggleStyle ( . checkbox)
70
- Toggle ( isOn: $lineWrapping, label: { Text ( " Line Wrapping " ) } )
71
- . toggleStyle ( . checkbox)
70
+ Menu {
71
+ Toggle ( isOn: $lineNumber, label: { Text ( " Line Number " ) } )
72
+ . toggleStyle ( . checkbox)
73
+ Toggle ( isOn: $lineWrapping, label: { Text ( " Line Wrapping " ) } )
74
+ . toggleStyle ( . checkbox)
75
+ Toggle ( isOn: $foldGutter, label: { Text ( " Fold Gutter " ) } )
76
+ . toggleStyle ( . checkbox)
77
+ Toggle ( isOn: $readOnly, label: { Text ( " Read Only " ) } )
78
+ . toggleStyle ( . checkbox)
79
+ } label: {
80
+ Image ( systemName: " gearshape.fill " )
81
+ . font ( . system( size: 18 ) )
82
+ . foregroundColor ( . secondary)
83
+ }
84
+ . menuIndicator ( . hidden)
85
+ . buttonStyle ( . plain)
72
86
Button {
73
87
count += 1
74
88
value = " Hello World! \( count) "
75
89
} label: {
76
90
Text ( " SET " )
77
91
}
78
- Toggle ( isOn: $readOnly, label: { Text ( " Read Only " ) } )
79
- . toggleStyle ( . checkbox)
80
92
Spacer ( )
81
93
Picker ( " Lang " , selection: $language) {
82
94
ForEach ( Language . allCases, id: \. rawValue) {
0 commit comments