Range-diff !488

Back to !488

Lint File: problems in the current file

1:  8f805b5 = 1:  f24016f Lint checkers for one file, matched to org-lint
2:  099bed0 ! 2:  5b5584b Lint File: panel on the Mac, list in iOS Commands
    @@ Sources/Orgstar/OrgstarApp.swift: struct OrgstarApp: App {
     
      ## Sources/OrgstarMobile/EditorScreen.swift ##
     @@ Sources/OrgstarMobile/EditorScreen.swift: struct EditorScreen: View {
    -         case crypt(CryptRequest)
    -         case backlinks
              case graph
    +         /// Rename Tag or Rename TODO Keyword, starting from this name.
    +         case rename(ReplaceKind, String)
     +        case lint
              /// The subtree at this offset, to export.
              case exportSubtree(Int)
      
     @@ Sources/OrgstarMobile/EditorScreen.swift: struct EditorScreen: View {
    -             case .crypt(let request): request.id.uuidString
                  case .backlinks: "backlinks"
                  case .graph: "graph"
    +             case .rename(let kind, _): kind.rawValue
     +            case .lint: "lint"
                  case .exportSubtree: "exportSubtree"
                  }
              }
     @@ Sources/OrgstarMobile/EditorScreen.swift: struct EditorScreen: View {
    -                 RoamGraphScreen(workspace: workspace, session: session, path: path, caret: editor?.editContext().caret ?? 0) { location in
    -                     if location.path == path { editor?.reveal(location.start) } else { model.openRequest = .heading(location) }
                      }
    +             case .rename(let kind, let initial):
    +                 RenameScreen(kind: kind, workspace: workspace, session: session, initial: initial) { message = $0 }
     +            case .lint:
     +                LintScreen(workspace: workspace, session: session, path: path) { offset in editor?.reveal(offset) }
                  }
              }
              .fileImporter(isPresented: $importingTable, allowedContentTypes: [.commaSeparatedText, .tabSeparatedText, .plainText]) { result in
     @@ Sources/OrgstarMobile/EditorScreen.swift: struct EditorScreen: View {
    -                 roamActions.run(id)
    -             } else if id == "app.backlinks" {
    -                 sheet = .backlinks
    +             } else if let kind = ReplaceKind(command: id), kind != .replace {
    +                 let context = self.editor?.editContext()
    +                 sheet = .rename(kind, context.map { kind.initial(text: $0.text, caret: $0.caret, keywords: $0.tree.settings.todoKeywordNames) } ?? "")
     +            } else if id == "app.lint" {
     +                if FileLint.applies(to: path) { sheet = .lint } else { message = String(localized: "Lint File works on Org files", comment: "Lint File in a file that isn't Org") }
                  } else if id == "app.toggle-markup" {
    @@ Sources/OrgstarMobile/MobileEditor.swift: final class MobileEditor: NSObject, Do
              case "app.crypt.encrypt-entry": return onAppCommand != nil && OrgCrypt.heading(context.text, at: context.caret) != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) == nil
              case "app.crypt.open-entry", "app.crypt.decrypt-entry": return onAppCommand != nil && OrgCrypt.encryptedRange(context.text, at: context.caret) != nil
              case "app.table-export", "app.table-export.tsv", "app.plot": return onAppCommand != nil && ImportTable.exportText(context.text, at: context.caret, path: "") != nil
    --        case "app.word-count", "app.recovery", "app.sync-conflicts", "app.attach.photo", "app.attach.camera", "app.attach.scan": return onAppCommand != nil
    -+        case "app.word-count", "app.recovery", "app.sync-conflicts", "app.lint", "app.attach.photo", "app.attach.camera", "app.attach.scan": return onAppCommand != nil
    +-        case "app.word-count", "app.recovery", "app.sync-conflicts", "app.attach.photo", "app.attach.camera", "app.attach.scan",
    ++        case "app.word-count", "app.recovery", "app.sync-conflicts", "app.lint", "app.attach.photo", "app.attach.camera", "app.attach.scan",
    +              "app.rename-tag", "app.rename-todo-keyword": return onAppCommand != nil
              case _ where id.hasPrefix(NamedMacros.commandPrefix): return true
              case "app.refile", "app.refile.copy", "app.archive": return onAppCommand != nil && Presentation.heading(containing: context.caret, in: context.tree) != nil
    -         case "app.export-dialog", "app.export-subtree-dialog", "app.copy-rich-text", "app.export.html-open", "app.export-body-only", "app.export.icalendar-agenda", "app.export.icalendar-combined": return onAppCommand != nil
     
      ## Tests/OrgAppTests/FileLintTests.swift (new) ##
     @@
    @@ Tests/OrgAppTests/FileLintTests.swift (new)
     +}
     
      ## docs/manual/guide/02-the-editor.org ##
    -@@ docs/manual/guide/02-the-editor.org: In Doom, =:s/PATTERN/REPLACEMENT/= and =:%s/…/…/= with the =g= and =i= flags
    +@@ docs/manual/guide/02-the-editor.org: How each file changes:
      
    - To search all your files, use the toolbar's search field; see [[file:01-files-and-folders.org][Files, folders and buffers]].
    + The echo area then says how many files changed. Org ▸ TODO and Tags has Rename Tag… and Rename TODO Keyword…, which work the same way but change only tags or keywords; see [[file:05-todos-and-tags.org][TODOs and tags]].
      
     +* Lint File
     +
    @@ l10n/Localizable.xcstrings
     +        }
     +      }
     +    },
    -     "Website": {
    +     "Was \"%@\"": {
    +       "comment": "Rename: the config.toml setting before the change",
            "localizations": {
    -         "de": {
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form