File tree Expand file tree Collapse file tree
Core/Sources/SuggestionWidget/SuggestionPanelContent Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ struct CodeBlock: View {
88 let commonPrecedingSpaceCount : Int
99 let highlightedCode : [ NSAttributedString ]
1010 let firstLinePrecedingSpaceCount : Int
11+
12+ @AppStorage ( \. disableLazyVStack) var disableLazyVStack
1113
1214 init (
1315 code: String ,
@@ -32,9 +34,22 @@ struct CodeBlock: View {
3234 commonPrecedingSpaceCount = result. commonLeadingSpaceCount
3335 highlightedCode = result. code
3436 }
37+
38+ @ViewBuilder
39+ func vstack( @ViewBuilder content: ( ) -> some View ) -> some View {
40+ if disableLazyVStack {
41+ VStack ( spacing: 4 ) {
42+ content ( )
43+ }
44+ } else {
45+ LazyVStack ( spacing: 4 ) {
46+ content ( )
47+ }
48+ }
49+ }
3550
3651 var body : some View {
37- VStack ( spacing : 4 ) {
52+ vstack {
3853 ForEach ( 0 ..< highlightedCode. endIndex, id: \. self) { index in
3954 HStack ( alignment: . firstTextBaseline, spacing: 4 ) {
4055 Text ( " \( index + startLineIndex + 1 ) " )
You can’t perform that action at this time.
0 commit comments