krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

Commit 32bc22b560

32bc22b560ddee58768489a481583c727358f833

parent: ec4eda648b

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-05 05:43 UTC

Table keys and display settings in the app

Layout: unified · split

Sources/OrgEditorAppKit/EditorCommands.swift +1 −1
@@ -31,7 +31,7 @@ public struct EditorCommand: Sendable {
3131}
3232
3333public enum EditorCommands {
34 public static let all: [EditorCommand] = Commands.all.map { EditorCommand(id: $0.id, title: $0.title, action: .text($0)) } + [
34 public static let all: [EditorCommand] = Commands.everything.map { EditorCommand(id: $0.id, title: $0.title, action: .text($0)) } + [
3535 EditorCommand(id: "org.cycle", title: "Cycle Visibility", action: .view),
3636 EditorCommand(id: "org.cycle-global", title: "Cycle Global Visibility", action: .view),
3737
Sources/Orgstar/ContentView.swift +6 −1
@@ -17,9 +17,14 @@ struct ContentView: View {
1717 @AppStorage("splitLine") private var splitLine = false
1818 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
1919 @AppStorage("fillColumn") private var fillColumn = 80
20 @AppStorage("hiddenMarkers") private var hiddenMarkers = true
21 @AppStorage("prettyEntities") private var prettyEntities = true
2022
2123 private var options: EditingOptions {
22 Preferences.options(tagsColumn: tagsColumn, headingAfterSubtree: headingAfterSubtree, splitLine: splitLine, alphabeticalLists: alphabeticalLists, fillColumn: fillColumn)
24 Preferences.options(
25 tagsColumn: tagsColumn, headingAfterSubtree: headingAfterSubtree, splitLine: splitLine, alphabeticalLists: alphabeticalLists,
26 fillColumn: fillColumn, hiddenMarkers: hiddenMarkers, prettyEntities: prettyEntities
27 )
2328 }
2429 @State private var selectedFile: String?
2530 @State private var query = ""
Sources/Orgstar/OrgstarApp.swift +7
@@ -155,6 +155,8 @@ struct SettingsView: View {
155155 @AppStorage("splitLine") private var splitLine = false
156156 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
157157 @AppStorage("fillColumn") private var fillColumn = 80
158 @AppStorage("hiddenMarkers") private var hiddenMarkers = true
159 @AppStorage("prettyEntities") private var prettyEntities = true
158160 @AppStorage("todoKeywords") private var todoKeywords = Preferences.defaultTodoKeywords
159161
160162 var body: some View {
@@ -186,6 +188,11 @@ struct SettingsView: View {
186188 Toggle("M-RET splits the line at the caret", isOn: $splitLine)
187189 Toggle("Lists can use letters (a. b. c.)", isOn: $alphabeticalLists)
188190 Stepper("M-q fills to column \(fillColumn)", value: $fillColumn, in: 40...200)
191 Toggle("Emacs hides emphasis markers (org-hide-emphasis-markers)", isOn: $hiddenMarkers)
192 Toggle("Emacs shows entities as characters (org-pretty-entities)", isOn: $prettyEntities)
193 Text("Tags, tables and M-q measure text as your Emacs displays it, so both write the same file.")
194 .font(.caption)
195 .foregroundStyle(.secondary)
189196 TextField("Default TODO keywords:", text: $todoKeywords)
190197 Text("For files without #+TODO, in #+TODO syntax. Takes effect when Orgstar restarts.")
191198 .font(.caption)
Sources/Orgstar/Preferences.swift +6 −2
@@ -11,10 +11,14 @@ enum Preferences {
1111 return OrgSettings.default.withTodoKeywords(line) ?? .default
1212 }
1313
14 static func options(tagsColumn: Int, headingAfterSubtree: Bool, splitLine: Bool, alphabeticalLists: Bool, fillColumn: Int) -> EditingOptions {
14 static func options(
15 tagsColumn: Int, headingAfterSubtree: Bool, splitLine: Bool, alphabeticalLists: Bool, fillColumn: Int,
16 hiddenMarkers: Bool, prettyEntities: Bool
17 ) -> EditingOptions {
1518 EditingOptions(
1619 tagsColumn: tagsColumn, insertHeadingRespectContent: headingAfterSubtree,
17 metaReturnMaySplitLine: splitLine, listAllowAlphabetical: alphabeticalLists, fillColumn: fillColumn
20 metaReturnMaySplitLine: splitLine, listAllowAlphabetical: alphabeticalLists, fillColumn: fillColumn,
21 hideEmphasisMarkers: hiddenMarkers, prettyEntities: prettyEntities, subSuperscriptsNeedBraces: true
1822 )
1923 }
2024}