krz/orgstar

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

Commit b0ca506efd

b0ca506efd9515fa52a92b52fea3c28a8e55e708

parent: 7708760851

Verified · cmc

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

M-q in the app

Layout: unified · split

Sources/Orgstar/ContentView.swift +2 −1
@@ -16,9 +16,10 @@ struct ContentView: View {
16 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true 16 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true
17 @AppStorage("splitLine") private var splitLine = false 17 @AppStorage("splitLine") private var splitLine = false
18 @AppStorage("alphabeticalLists") private var alphabeticalLists = true 18 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
19 @AppStorage("fillColumn") private var fillColumn = 80
19 20
20 private var options: EditingOptions { 21 private var options: EditingOptions {
21 Preferences.options(tagsColumn: tagsColumn, headingAfterSubtree: headingAfterSubtree, splitLine: splitLine, alphabeticalLists: alphabeticalLists) 22 Preferences.options(tagsColumn: tagsColumn, headingAfterSubtree: headingAfterSubtree, splitLine: splitLine, alphabeticalLists: alphabeticalLists, fillColumn: fillColumn)
22 } 23 }
23 @State private var selectedFile: String? 24 @State private var selectedFile: String?
24 @State private var query = "" 25 @State private var query = ""
Sources/Orgstar/OrgstarApp.swift +2
@@ -154,6 +154,7 @@ struct SettingsView: View {
154 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true 154 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true
155 @AppStorage("splitLine") private var splitLine = false 155 @AppStorage("splitLine") private var splitLine = false
156 @AppStorage("alphabeticalLists") private var alphabeticalLists = true 156 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
157 @AppStorage("fillColumn") private var fillColumn = 80
157 @AppStorage("todoKeywords") private var todoKeywords = Preferences.defaultTodoKeywords 158 @AppStorage("todoKeywords") private var todoKeywords = Preferences.defaultTodoKeywords
158 159
159 var body: some View { 160 var body: some View {
@@ -184,6 +185,7 @@ struct SettingsView: View {
184 Toggle("M-RET adds the new heading after the subtree", isOn: $headingAfterSubtree) 185 Toggle("M-RET adds the new heading after the subtree", isOn: $headingAfterSubtree)
185 Toggle("M-RET splits the line at the caret", isOn: $splitLine) 186 Toggle("M-RET splits the line at the caret", isOn: $splitLine)
186 Toggle("Lists can use letters (a. b. c.)", isOn: $alphabeticalLists) 187 Toggle("Lists can use letters (a. b. c.)", isOn: $alphabeticalLists)
188 Stepper("M-q fills to column \(fillColumn)", value: $fillColumn, in: 40...200)
187 TextField("Default TODO keywords:", text: $todoKeywords) 189 TextField("Default TODO keywords:", text: $todoKeywords)
188 Text("For files without #+TODO, in #+TODO syntax. Takes effect when Orgstar restarts.") 190 Text("For files without #+TODO, in #+TODO syntax. Takes effect when Orgstar restarts.")
189 .font(.caption) 191 .font(.caption)
Sources/Orgstar/Preferences.swift +2 −2
@@ -11,10 +11,10 @@ enum Preferences {
11 return OrgSettings.default.withTodoKeywords(line) ?? .default 11 return OrgSettings.default.withTodoKeywords(line) ?? .default
12 } 12 }
13 13
14 static func options(tagsColumn: Int, headingAfterSubtree: Bool, splitLine: Bool, alphabeticalLists: Bool) -> EditingOptions { 14 static func options(tagsColumn: Int, headingAfterSubtree: Bool, splitLine: Bool, alphabeticalLists: Bool, fillColumn: Int) -> EditingOptions {
15 EditingOptions( 15 EditingOptions(
16 tagsColumn: tagsColumn, insertHeadingRespectContent: headingAfterSubtree, 16 tagsColumn: tagsColumn, insertHeadingRespectContent: headingAfterSubtree,
17 metaReturnMaySplitLine: splitLine, listAllowAlphabetical: alphabeticalLists 17 metaReturnMaySplitLine: splitLine, listAllowAlphabetical: alphabeticalLists, fillColumn: fillColumn
18 ) 18 )
19 } 19 }
20} 20}