krz/orgstar

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

Commit e0c1e99fae

e0c1e99fae4aa4da59acc11a2fc5c0b08028f528

parent: 3f59087b14

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-07 23:51 UTC

Fix build warnings

Exclude the conformance fixtures from OrgCoreTests, silence the 64-to-32
warning in the vendored tree-sitter scanners, apply snipe's operator-pending
check to both s and S, and clear the Swift warnings.

Layout: unified · split

Package.swift +3 −2
@@ -54,7 +54,8 @@ let package = Package(
5454 .target(name: "TreeSitterClojure", path: "Sources/TreeSitterClojure", sources: ["src/parser.c"], cSettings: [.headerSearchPath("src")]),
5555 .target(
5656 name: "TreeSitterScanners", path: "Sources/TreeSitterScanners",
57 sources: ["javascript/scanner.c", "lua/scanner.c", "python/scanner.c", "yaml/scanner.c"]
57 sources: ["javascript/scanner.c", "lua/scanner.c", "python/scanner.c", "yaml/scanner.c"],
58 cSettings: [.unsafeFlags(["-Wno-shorten-64-to-32"])]
5859 ),
5960 .target(
6061 name: "OrgHighlight",
@@ -89,7 +90,7 @@ let package = Package(
8990 .executableTarget(name: "OrgstarSpotlight", dependencies: ["OrgCore"], linkerSettings: extensionEntry),
9091 // The iOS share extension, bundled into the iOS app by scripts/build-ios-app.sh.
9192 .executableTarget(name: "OrgstarShare", dependencies: ["OrgApp"], linkerSettings: extensionEntry),
92 .testTarget(name: "OrgCoreTests", dependencies: ["OrgCore"]),
93 .testTarget(name: "OrgCoreTests", dependencies: ["OrgCore"], exclude: ["Conformance"]),
9394 .testTarget(name: "OrgDocumentTests", dependencies: ["OrgDocument"]),
9495 .testTarget(name: "OrgIndexTests", dependencies: ["OrgIndex"]),
9596 .testTarget(name: "OrgWorkspaceTests", dependencies: ["OrgWorkspace"]),
Sources/OrgCore/Agenda/AgendaSearch.swift +1 −1
@@ -111,7 +111,7 @@ public struct TagsMatcher: Sendable {
111111
112112 if tagsPart.contains(where: { !$0.isWhitespace }) {
113113 var alternatives: [[Term]] = []
114 var parts = Self.split(tagsPart)
114 let parts = Self.split(tagsPart)
115115 var i = 0
116116 while i < parts.count {
117117 var part = parts[i]
Sources/OrgCore/Commands/Fill.swift +1 −1
@@ -305,7 +305,7 @@ extension EmacsBuffer {
305305 /// `fill-region-as-paragraph` with left justification and adaptive fill.
306306 func fillRegionAsParagraph(_ fromOffset: Int, _ toOffset: Int, prefix fixedPrefix: String? = nil) {
307307 point = min(fromOffset, toOffset)
308 var to = max(fromOffset, toOffset)
308 let to = max(fromOffset, toOffset)
309309 skipForward(Self.whitespace)
310310 let fromPlusIndent = point
311311 point = lineStart(point)
Sources/OrgCore/Commands/TagCommands.swift +1 −1
@@ -62,7 +62,7 @@ public struct SetTags: OrgCommand {
6262 commitBuffer(context) { buffer in
6363 try buffer.saveExcursion {
6464 try buffer.backToHeading()
65 try buffer.saveExcursion {
65 buffer.saveExcursion {
6666 let line = buffer.saveExcursion { buffer.lookingAt(Self.tagLine) }
6767 let old = line.flatMap { $0[2] }.map { buffer.substring($0.lowerBound, $0.upperBound).split(separator: ":").map(String.init) } ?? []
6868 if tags != old {
Sources/OrgCore/Config/Elisp.swift +1 −1
@@ -584,7 +584,7 @@ public final class Elisp {
584584 guard let last = args.last else { return .nil }
585585 var items: [Sexp] = []
586586 for arg in args.dropLast() { items += try sequence(arg) }
587 return try items.reversed().reduce(last) { cons($1, $0) }
587 return items.reversed().reduce(last) { cons($1, $0) }
588588 }
589589 lisp.define("length") { _, args in
590590 try arity(args, 1...1, "length")
Sources/OrgCore/Config/Lisp.swift +1 −1
@@ -198,7 +198,7 @@ public enum LispReader {
198198 case "t": return 9
199199 case "s": return 32
200200 case "e": return 27
201 case "C", "M", "S", "s", "H", "A":
201 case "C", "M", "S", "H", "A":
202202 if peek == "-" { _ = next(); return try character() }
203203 return Int(e.value)
204204 default: return Int(e.value)
Sources/OrgCore/Keymap/Vim.swift +1 −1
@@ -599,7 +599,7 @@ public struct Vim: Sendable {
599599 }
600600 guard let p = find(kind, last.char, buffer, c, count: n, repeating: true) else { return .invalid }
601601 return .moved(p, kind == "f" || kind == "t" ? .inclusive : .exclusive)
602 case ("s", []), ("S", []) where !operatorPending:
602 case ("s", []) where !operatorPending, ("S", []) where !operatorPending:
603603 // evil-snipe with `evil-snipe-scope` line.
604604 guard keys.count >= 3 else { return .incomplete }
605605 let chars = keys[1].key + keys[2].key
Sources/Orgstar/AgendaView.swift +2 −1
@@ -738,7 +738,8 @@ struct AgendaRow: View {
738738 guard let todo = item.todo, text.hasPrefix(todo + " ") else { return Text(text) }
739739 let rest = String(text.dropFirst(todo.count))
740740 let rest_ = Text(rest).foregroundColor(item.isDone ? theme.color("comment") ?? .secondary : theme.color("foreground") ?? .primary)
741 return Text(todo).foregroundColor(theme.keywordColor(todo, done: item.isDone)).bold() + rest_
741 let todo_ = Text(todo).foregroundColor(theme.keywordColor(todo, done: item.isDone)).bold()
742 return Text("\(todo_)\(rest_)")
742743 }
743744}
744745
Sources/Orgstar/FastSelectionView.swift +1
@@ -1,4 +1,5 @@
11import OrgCore
2import OrgPresentation
23import SwiftUI
34
45/// Fast TODO and tag selection in the echo area: each option with its key. TODO keywords take
Sources/Orgstar/Keys.swift +1
@@ -1,6 +1,7 @@
11import OrgApp
22import OrgCore
33import OrgEditorAppKit
4import OrgPresentation
45import SwiftUI
56
67struct KeyHint: Hashable {