Skip to content

Commit bebd4ba

Browse files
committed
Fix buffer height coverage issue
1 parent ffb2009 commit bebd4ba

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

Controllers/ViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ class ViewController:
387387
DispatchQueue.main.async {
388388
self.editArea.updateTextContainerInset()
389389
}
390-
editArea.textContainerInset.height = 10
391390
editArea.isEditable = false
392391
editArea.layoutManager?.defaultAttachmentScaling = .scaleProportionallyDown
393392
search.font = UserDefaultsManagement.searchFont

Views/EditTextView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,12 @@ class EditTextView: NSTextView, @preconcurrency NSTextFinderClient {
733733
let lineWidth = UserDefaultsManagement.lineWidth
734734
let margin = UserDefaultsManagement.marginSize
735735
let width = frame.width
736+
737+
// Set bottom padding for comfortable editing (4 lines of space)
738+
let lineHeight: CGFloat = 24
739+
let bottomPadding = lineHeight * 4
740+
textContainerInset.height = bottomPadding
741+
736742
if lineWidth == 1000 {
737743
textContainerInset.width = CGFloat(margin)
738744
return

Views/EditorScrollView.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@ class EditorScrollView: NSScrollView {
66

77
override func layout() {
88
super.layout()
9-
updateBottomPadding()
10-
}
11-
12-
private func updateBottomPadding() {
13-
// Keep 4 lines of space at bottom for comfortable editing
14-
let lineHeight: CGFloat = 24
15-
let bottomPadding = lineHeight * 4
16-
17-
contentView.contentInsets.bottom = bottomPadding
189
}
1910

2011
override var isFindBarVisible: Bool {

0 commit comments

Comments
 (0)