File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed
Core/Sources/SuggestionWidget/SuggestionPanelContent Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ struct CodeBlock: View {
4242 @ViewBuilder
4343 func vstack( @ViewBuilder content: ( ) -> some View ) -> some View {
4444 if disableLazyVStack {
45- VStack ( spacing: 4 ) {
45+ VStack ( spacing: 2 ) {
4646 content ( )
4747 }
4848 } else {
49- LazyVStack ( spacing: 4 ) {
49+ LazyVStack ( spacing: 2 ) {
5050 content ( )
5151 }
5252 }
@@ -78,7 +78,7 @@ struct CodeBlock: View {
7878 }
7979 }
8080 . foregroundColor ( . white)
81- . font ( . system( size: 12 , design: . monospaced) )
81+ . font ( . system( size: fontSize , design: . monospaced) )
8282 . padding ( . leading, 4 )
8383 . padding ( [ . trailing, . top, . bottom] )
8484 }
@@ -99,3 +99,22 @@ struct CodeBlock: View {
9999 )
100100 }
101101}
102+
103+ // MARK: - Preview
104+
105+ struct CodeBlock_Previews : PreviewProvider {
106+ static var previews : some View {
107+ CodeBlock (
108+ code: """
109+ let foo = Foo()
110+ let bar = Bar()
111+ """ ,
112+ language: " swift " ,
113+ startLineIndex: 0 ,
114+ colorScheme: . dark,
115+ firstLinePrecedingSpaceCount: 0 ,
116+ fontSize: 12
117+ )
118+ }
119+ }
120+
You can’t perform that action at this time.
0 commit comments