Skip to content

Commit

Permalink
Bump CETV, Revert Trailing Padding (#272) (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoolwinter authored Feb 4, 2025
1 parent f51ed8e commit 6b2c945
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditLanguages.git",
"state" : {
"revision" : "5b27f139269e1ea49ceae5e56dca44a3ccad50a1",
"version" : "0.1.19"
"revision" : "331d5dbc5fc8513be5848fce8a2a312908f36a11",
"version" : "0.1.20"
}
},
{
Expand Down Expand Up @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChimeHQ/SwiftTreeSitter.git",
"state" : {
"revision" : "2599e95310b3159641469d8a21baf2d3d200e61f",
"version" : "0.8.0"
"revision" : "36aa61d1b531f744f35229f010efba9c6d6cbbdd",
"version" : "0.9.0"
}
},
{
Expand All @@ -62,6 +62,15 @@
"revision" : "8dc9148b46fcf93b08ea9d4ef9bdb5e4f700e008",
"version" : "0.9.0"
}
},
{
"identity" : "tree-sitter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tree-sitter/tree-sitter",
"state" : {
"revision" : "d97db6d63507eb62c536bcb2c4ac7d70c8ec665e",
"version" : "0.23.2"
}
}
],
"version" : 2
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditTextView.git",
"state" : {
"revision" : "8ceb3fdff6c7736adcc506ce5aee4eb91973d783",
"version" : "0.7.8"
"revision" : "1792167c751b6668b4743600d2cf73d2829dd18a",
"version" : "0.7.9"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let package = Package(
// A fast, efficient, text view for code.
.package(
url: "https://github.com/CodeEditApp/CodeEditTextView.git",
from: "0.7.7"
from: "0.7.9"
),
// tree-sitter languages
.package(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import AppKit
import CodeEditTextView

extension TextViewController {
package func generateParagraphStyle() -> NSMutableParagraphStyle {
Expand Down
18 changes: 12 additions & 6 deletions Sources/CodeEditSourceEditor/Controller/TextViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ public class TextViewController: NSViewController {
didSet {
textView.layoutManager.wrapLines = wrapLines
scrollView.hasHorizontalScroller = !wrapLines
textView.edgeInsets = HorizontalEdgeInsets(
left: textView.edgeInsets.left,
right: textViewTrailingInset // Refresh this value, see docs
)
textView.textInsets = textViewInsets
}
}

Expand Down Expand Up @@ -200,7 +197,16 @@ public class TextViewController: NSViewController {

/// The trailing inset for the editor. Grows when line wrapping is disabled.
package var textViewTrailingInset: CGFloat {
wrapLines ? 1 : 48
// See https://github.com/CodeEditApp/CodeEditTextView/issues/66
// wrapLines ? 1 : 48
0
}

package var textViewInsets: HorizontalEdgeInsets {
HorizontalEdgeInsets(
left: gutterView.gutterWidth,
right: textViewTrailingInset
)
}

// MARK: Init
Expand Down Expand Up @@ -329,6 +335,6 @@ public class TextViewController: NSViewController {
extension TextViewController: GutterViewDelegate {
public func gutterViewWidthDidUpdate(newWidth: CGFloat) {
gutterView?.frame.size.width = newWidth
textView?.edgeInsets = HorizontalEdgeInsets(left: newWidth, right: textViewTrailingInset)
textView?.textInsets = textViewInsets
}
}

0 comments on commit 6b2c945

Please sign in to comment.