Skip to content

Commit 3fdd073

Browse files
committed
Move Text Padding in CodeFileView, Stabilize TreeSitterClient
1 parent 8c44d9c commit 3fdd073

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CodeEdit/Features/Editor/Views/CodeFileView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ struct CodeFileView: View {
5050

5151
@ObservedObject private var themeModel: ThemeModel = .shared
5252

53+
@State private var treeSitter = TreeSitterClient()
54+
5355
private var cancellables = Set<AnyCancellable>()
5456

5557
private let isEditable: Bool
@@ -115,7 +117,9 @@ struct CodeFileView: View {
115117
editorOverscroll: overscroll.overscrollPercentage,
116118
cursorPositions: $cursorPositions,
117119
useThemeBackground: useThemeBackground,
120+
highlightProviders: [treeSitter],
118121
contentInsets: edgeInsets.nsEdgeInsets,
122+
additionalTextInsets: NSEdgeInsets(top: 2, left: 0, bottom: 0, right: 0),
119123
isEditable: isEditable,
120124
letterSpacing: letterSpacing,
121125
bracketPairEmphasis: getBracketPairEmphasis(),

CodeEdit/Features/Editor/Views/EditorAreaView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ struct EditorAreaView: View {
4646
}
4747

4848
var editorInsetAmount: Double {
49-
let tabBarHeight = shouldShowTabBar ? (EditorTabBarView.height + 1) : 0
50-
let jumpBarHeight = showEditorJumpBar ? (EditorJumpBarView.height + 1) : 0
49+
let tabBarHeight = shouldShowTabBar ? (EditorTabBarView.height) : 0
50+
let jumpBarHeight = showEditorJumpBar ? (EditorJumpBarView.height) : 0
5151
return tabBarHeight + jumpBarHeight
5252
}
5353

0 commit comments

Comments
 (0)