Skip to content

Update CESE to 0.13.0 #2046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1622,7 +1622,7 @@
repositoryURL = "https://github.com/CodeEditApp/CodeEditSymbols";
requirement = {
kind = exactVersion;
version = 0.2.2;
version = 0.2.3;
};
};
287136B1292A407E00E9F5F4 /* XCRemoteSwiftPackageReference "SwiftLintPlugin" */ = {
Expand Down Expand Up @@ -1749,8 +1749,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/CodeEditApp/CodeEditSourceEditor";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.12.0;
kind = exactVersion;
version = 0.13.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditSourceEditor",
"state" : {
"revision" : "412b0a26cbeb3f3148a1933dd598c976defe92a6",
"version" : "0.12.0"
"revision" : "b96f270ab58bdbe0406de31d4c983d75732fccf5",
"version" : "0.13.0"
}
},
{
"identity" : "codeeditsymbols",
"kind" : "remoteSourceControl",
"location" : "https://github.com/CodeEditApp/CodeEditSymbols",
"state" : {
"revision" : "a794528172314f9be5d838f8579c4435895e0988",
"version" : "0.2.2"
"revision" : "ae69712b08571c4469c2ed5cd38ad9f19439793e",
"version" : "0.2.3"
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion CodeEdit/Features/Editor/Views/CodeFileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ struct CodeFileView: View {
var useSystemCursor
@AppSettings(\.textEditing.showMinimap)
var showMinimap
@AppSettings(\.textEditing.reformatAtColumn)
var reformatAtColumn
@AppSettings(\.textEditing.showReformattingGuide)
var showReformattingGuide

@Environment(\.colorScheme)
private var colorScheme
Expand Down Expand Up @@ -135,7 +139,9 @@ struct CodeFileView: View {
useSystemCursor: useSystemCursor,
undoManager: undoManager,
coordinators: textViewCoordinators,
showMinimap: showMinimap
showMinimap: showMinimap,
reformatAtColumn: reformatAtColumn,
showReformattingGuide: showReformattingGuide
)
.id(codeFile.fileURL)
.background {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extension SettingsData {
"Bracket Pair Emphasis",
"Bracket Pair Highlight",
"Show Minimap",
"Reformat at Column",
"Show Reformatting Guide",
]
if #available(macOS 14.0, *) {
keys.append("System Cursor")
Expand Down Expand Up @@ -74,6 +76,12 @@ extension SettingsData {
/// Toggle the minimap in the editor.
var showMinimap: Bool = true

/// The column at which to reformat text
var reformatAtColumn: Int = 80

/// Show the reformatting guide in the editor
var showReformattingGuide: Bool = false

/// Default initializer
init() {
self.populateCommands()
Expand Down Expand Up @@ -123,6 +131,11 @@ extension SettingsData {
}

self.showMinimap = try container.decodeIfPresent(Bool.self, forKey: .showMinimap) ?? true
self.reformatAtColumn = try container.decodeIfPresent(Int.self, forKey: .reformatAtColumn) ?? 80
self.showReformattingGuide = try container.decodeIfPresent(
Bool.self,
forKey: .showReformattingGuide
) ?? false

self.populateCommands()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct TextEditingSettingsView: View {
useSystemCursor
overscroll
showMinimap
reformatSettings
}
Section {
fontSelector
Expand Down Expand Up @@ -206,4 +207,21 @@ private extension TextEditingSettingsView {
// swiftlint:disable:next line_length
.help("The minimap gives you a high-level summary of your source code, with controls to quickly navigate your document.")
}

@ViewBuilder private var reformatSettings: some View {
Stepper(
"Reformat at Column",
value: Binding<Double>(
get: { Double(textEditing.reformatAtColumn) },
set: { textEditing.reformatAtColumn = Int($0) }
),
in: 40...200,
step: 1,
format: .number
)
.help("The column at which text should be reformatted")

Toggle("Show Reformatting Guide", isOn: $textEditing.showReformattingGuide)
.help("Shows a vertical guide at the reformat column")
}
}
Loading