Commit 512650677f

512650677f4f383db027d187f15a091f62cb3cab

parent: 6411be88fd

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 21:11 UTC

Mac View menu: toggles that state their state

Show Outline, Show Backlinks, Show Columns and Clock, Truncate Long Lines, Auto Fill and Check Spelling While Typing are toggles with a check mark while on.

Ref #223

Layout: unified · split

Changed files (11)
Sources/OrgEditorAppKit/OrgEditor.swift +1 −1 · view
@@ -514,7 +514,7 @@ public final class OrgEditor: NSObject {
514514
515515 /// `auto-fill-mode` for this buffer: the settings' unless toggled here.
516516 public var autoFillOverride: Bool?
517 var autoFills: Bool { isOrg && (autoFillOverride ?? options.autoFill) }
517 public var autoFills: Bool { isOrg && (autoFillOverride ?? options.autoFill) }
518518
519519 /// SPC with `auto-fill-mode`: true when it typed the space and filled the line.
520520 func autoFill(_ key: KeyChord) -> Bool {
Sources/Orgstar/ContentView.swift +1 · view
@@ -312,6 +312,7 @@ struct ContentView: View {
312312 .searchFocused($searchFocused)
313313 .toolbar(id: "main") { toolbarItems }
314314 .onChange(of: session.path) { plainOutlineShown = false }
315 .onChange(of: outlineShown, initial: true) { _, shown in commands.outlineShown = shown }
315316 .onChange(of: ScanRules(hiddenFiles: showHiddenFiles, ignoredFolders: Set(ignoredFolders.split(separator: " ").map(String.init))), initial: true) { _, rules in
316317 workspace.scanRules = rules
317318 }
Sources/Orgstar/OrgstarApp.swift +31 −10 · view
@@ -24,6 +24,8 @@ final class AppCommands {
2424 var showingConflict = false
2525 var showingPalette = false
2626 var showingMessages = false
27 /// The main window's outline pane is shown, for View ▸ Show Outline.
28 var outlineShown = false
2729 /// A location another window asked the main window to show.
2830 private(set) var jumpRequest: (path: String, offset: Int, id: Int)?
2931 private var jumpID = 0
@@ -539,16 +541,7 @@ struct OrgstarApp: App {
539541 Button("Next Pane") { commands.run("app.pane-next") }
540542 .keyboardShortcut("`", modifiers: [.command, .option])
541543 Divider()
542 Button("Show or Hide Outline") { commands.run("app.toggle-outline") }
543 .keyboardShortcut("o", modifiers: [.command, .option])
544 Button("Show or Hide Backlinks") { commands.run("app.toggle-backlinks") }
545 Button("Show or Hide Columns and Clock") { commands.run("app.toggle-inspector") }
546 .keyboardShortcut("i", modifiers: [.command, .option])
547 MarkupToggle()
548 Button("Truncate or Wrap Long Lines") { commands.run("editor.toggle-truncate-lines") }
549 Button("Turn Auto Fill On or Off") { commands.run("editor.toggle-auto-fill") }
550 Button("Check Spelling While Typing") { commands.editor?.run("editor.toggle-spell-check") }
551 .disabled(commands.editor == nil)
544 ViewMenuToggles(commands: commands)
552545 Divider()
553546 Button("Messages") { commands.run("app.messages") }
554547 }
@@ -673,6 +666,34 @@ enum Manual {
673666 static let keys = URL(string: "https://files.krz.sh/orgstar/guide/03-keys.html#key-reference")!
674667}
675668
669/// View ▸ the panes and the focused editor's modes, checked while on.
670struct ViewMenuToggles: View {
671 let commands: AppCommands
672 @AppStorage("backlinksShown") private var backlinksShown = true
673 @AppStorage("inspectorShown") private var inspectorShown = false
674
675 var body: some View {
676 let outline = commands.outlineShown
677 let editor = commands.editor
678 // A key that switches an editor mode shows a message, so the checks follow it.
679 let _ = commands.message
680 Toggle("Show Outline", isOn: Binding(get: { outline }, set: { _ in commands.run("app.toggle-outline") }))
681 .keyboardShortcut("o", modifiers: [.command, .option])
682 Toggle("Show Backlinks", isOn: $backlinksShown)
683 Toggle("Show Columns and Clock", isOn: $inspectorShown)
684 .keyboardShortcut("i", modifiers: [.command, .option])
685 MarkupToggle()
686 editorToggle("Truncate Long Lines", "editor.toggle-truncate-lines", editor?.truncatesLines)
687 editorToggle("Auto Fill", "editor.toggle-auto-fill", editor?.autoFills)
688 editorToggle("Check Spelling While Typing", "editor.toggle-spell-check", editor?.spellChecking)
689 }
690
691 private func editorToggle(_ title: LocalizedStringKey, _ id: String, _ on: Bool?) -> some View {
692 Toggle(title, isOn: Binding(get: { on ?? false }, set: { _ in commands.editor?.run(id) }))
693 .disabled(on == nil)
694 }
695}
696
676697/// View ▸ Show Markup (link brackets and targets, emphasis markers) and Show Line Numbers.
677698struct MarkupToggle: View {
678699 @AppStorage("showTabBar") private var showTabBar = false
docs/manual/guide/01-files-and-folders.org +6 −6 · view
@@ -33,12 +33,12 @@ Several commands in this chapter are only in the palette, not in a menu: Close O
3333
3434| Menu item | Shortcut | Palette title |
3535|------------------------------------------+----------+----------------------------------|
36| View ▸ Show or Hide Outline | =⌥⌘O= | Show or Hide Outline |
37| View ▸ Show or Hide Backlinks | | Show or Hide Backlinks |
38| View ▸ Show or Hide Columns and Clock | =⌥⌘I= | Show or Hide Columns and Clock |
36| View ▸ Show Outline | =⌥⌘O= | Show or Hide Outline |
37| View ▸ Show Backlinks | | Show or Hide Backlinks |
38| View ▸ Show Columns and Clock | =⌥⌘I= | Show or Hide Columns and Clock |
3939| View ▸ Show Tab Bar | | Show or Hide Tab Bar |
4040
41The toolbar's outline button does the same as View ▸ Show or Hide Outline. The sidebar is shown and hidden with the standard View menu command. The button at the right of the bar under it switches it between the files and an agenda; see [[file:07-agenda.org][The agenda]].
41The toolbar's outline button does the same as View ▸ Show Outline. The sidebar is shown and hidden with the standard View menu command. The button at the right of the bar under it switches it between the files and an agenda; see [[file:07-agenda.org][The agenda]].
4242
4343orgstar remembers whether the outline, backlinks and inspector are shown. The outline pane's visibility is remembered for org files only: for other files it starts hidden each time you open one. Drag the divider on the outline pane's right edge to resize it (160 to 400 points; 220 by default).
4444
@@ -197,11 +197,11 @@ The outline follows your edits after a short pause in typing.
197197
198198** Backlinks
199199
200Under the outline, the backlinks pane lists headings in your folders that link to the current file (a link before a file's first heading is listed under the file's name) (=Links to this file=) and to the heading at the caret (=Links to= followed by the heading's title). It updates as you move the caret. Click an entry to open it. Turn the pane off with View ▸ Show or Hide Backlinks. Which links count is covered in [[file:09-links.org][Links]].
200Under the outline, the backlinks pane lists headings in your folders that link to the current file (a link before a file's first heading is listed under the file's name) (=Links to this file=) and to the heading at the caret (=Links to= followed by the heading's title). It updates as you move the caret. Click an entry to open it. Turn the pane off with View ▸ Show Backlinks. Which links count is covered in [[file:09-links.org][Links]].
201201
202202** Inspector
203203
204View ▸ Show or Hide Columns and Clock (=⌥⌘I=) opens a pane on the right with column view and clocked time for the file or the current subtree. See [[file:04-outlines.org][Outlines]] and [[file:06-dates-and-clocking.org][Dates and clocking]].
204View ▸ Show Columns and Clock (=⌥⌘I=) opens a pane on the right with column view and clocked time for the file or the current subtree. See [[file:04-outlines.org][Outlines]] and [[file:06-dates-and-clocking.org][Dates and clocking]].
205205
206206* Saving
207207
docs/manual/guide/02-the-editor.org +6 −4 · view
@@ -298,7 +298,7 @@ On iOS, spell checking follows =spell-check= in the synced =config.toml=, and is
298298
299299* Wrapping and filling
300300
301Long lines wrap at the edge of the editor by default. View ▸ Truncate or Wrap Long Lines (=toggle-truncate-lines=) switches the current buffer to long lines that run off the right edge, with a horizontal scroll bar, and back. The echo area says which is now in effect.
301Long lines wrap at the edge of the editor by default. View ▸ Truncate Long Lines (=toggle-truncate-lines=) switches the current buffer to long lines that run off the right edge, with a horizontal scroll bar, and back. The echo area says which is now in effect.
302302
303303| Preset | Key |
304304|--------+------------------------------|
@@ -310,19 +310,21 @@ To truncate lines in every file, turn on Settings ▸ Editing ▸ "Long lines ru
310310
311311Wrapping is display only. To rewrap the text of a paragraph, use Org ▸ Fill Paragraph (=org-fill-paragraph=), which breaks the paragraph's lines at the fill column: =M-q= in the Emacs preset and in every Doom state, =⌃⌘P= in the Mac preset. With a selection, it fills every paragraph the selection touches. In Doom's normal and visual states, =gq= and =gw= with a motion fill the paragraphs in the lines it covers (=gqq= and =gww= for the current lines); =gq= leaves the caret on the last line, =gw= where it was. Unlike Fill Paragraph, =gq= and =gw= keep extra spaces between words and at the ends of lines, as Doom does. See [[file:03-keys.org][Keys and commands]]. The fill column is Settings ▸ Editing ▸ "M-q fills to column N" (80 by default, 40 to 200), or =fill-column= in =config.toml=.
312312
313=auto-fill-mode= breaks lines as you type: typing a space past the fill column breaks the line at the last space before the column, as often as it takes, and the new line starts with the line's fill prefix, as =org-auto-fill-function= has it: a list item's text lines up under the item, a comment line starts with =#=, and headings, tables and code aren't broken. Turn it on for every file with =auto-fill-mode = true= in =config.toml=, or for the current buffer with View ▸ Turn Auto Fill On or Off (=auto-fill-mode=, in the palette too); the echo area says =Auto-Fill mode enabled in current buffer= or =disabled=. Only a typed space fills, not =RET=.
313=auto-fill-mode= breaks lines as you type: typing a space past the fill column breaks the line at the last space before the column, as often as it takes, and the new line starts with the line's fill prefix, as =org-auto-fill-function= has it: a list item's text lines up under the item, a comment line starts with =#=, and headings, tables and code aren't broken. Turn it on for every file with =auto-fill-mode = true= in =config.toml=, or for the current buffer with View ▸ Auto Fill (=auto-fill-mode=, in the palette too); the echo area says =Auto-Fill mode enabled in current buffer= or =disabled=. Only a typed space fills, not =RET=.
314314
315315* View toggles
316316
317The View menu shows a check mark next to each toggle that is on.
318
317319| Toggle | Menu | Keys | Default | =config.toml= | Scope |
318320|-------------------------------+-------------------------------+-------------------------------------------------+---------+----------------------------------+----------------|
319321| Show Markup | View ▸ Show Markup | =⇧⌘M= | off | =show-markup= | every buffer |
320322| Show Line Numbers | View ▸ Show Line Numbers | =⇧⌘L= | off | =display-line-numbers-type= | every buffer |
321| Auto fill | View ▸ Turn Auto Fill On or Off | palette | off | =auto-fill-mode= | current buffer |
323| Auto fill | View ▸ Auto Fill | palette | off | =auto-fill-mode= | current buffer |
322324| Inline images | Org ▸ Show or Hide Inline Images | =C-c C-x C-v= (Emacs, Doom) | off | =org-startup-with-inline-images= | current buffer |
323325| LaTeX previews | palette | =C-c C-x C-l= (Emacs, Doom) | off | =org-startup-with-latex-preview= | current buffer |
324326| Spell checking | View ▸ Check Spelling While Typing | =SPC t s= (Doom) | off | =spell-check= | current buffer |
325| Truncate long lines | View ▸ Truncate or Wrap Long Lines | =C-x x t= (Emacs), =SPC t w= (Doom) | off | =org-startup-truncated= | current buffer |
327| Truncate long lines | View ▸ Truncate Long Lines | =C-x x t= (Emacs), =SPC t w= (Doom) | off | =org-startup-truncated= | current buffer |
326328
327329Toggles that apply to the current buffer last until it closes; the =config.toml= setting decides how each file starts. Changing those settings, and =org-startup-indented= and =org-hide-leading-stars=, affects files opened afterwards, not buffers already open.
328330
docs/manual/guide/03-keys.org +6 −6 · view
@@ -130,15 +130,15 @@ These come from the menu bar and work in every preset. In the Doom preset, keys
130130| View | Close Pane | =⌃⌘0= |
131131| View | Close Other Panes | =⌃⌘1= |
132132| View | Next Pane | =⌥⌘`= |
133| View | Show or Hide Outline | =⌥⌘O= |
134| View | Show or Hide Columns and Clock | =⌥⌘I= |
133| View | Show Outline | =⌥⌘O= |
134| View | Show Columns and Clock | =⌥⌘I= |
135135| Window | Agenda | =⇧⌘A= |
136136| Window | Board | =⇧⌘B= |
137137| Window | Next Buffer | =⇧⌘]= |
138138| Window | Previous Buffer | =⇧⌘[= |
139139| File | New Window | =⌥⌘N= |
140140
141View ▸ Show or Hide Backlinks and Show Tab Bar, Window ▸ Switch to Buffer…, and the items of File ▸ Export have no shortcut.
141View ▸ Show Backlinks and Show Tab Bar, Window ▸ Switch to Buffer…, and the items of File ▸ Export have no shortcut.
142142
143143With Settings ▸ Capture ▸ "⌃⌥Space opens Capture from any app" on (the default), =⌃⌥Space= opens the Capture window from any application (see [[file:08-capture.org][Capture]]).
144144
@@ -1152,9 +1152,9 @@ No preset binds these. Run them from the palette or a menu, or bind them in =key
11521152| Decrypt Entry in File… (=app.crypt.decrypt-entry=) | Puts the decrypted text in the file (=org-decrypt-entry=). |
11531153| Encrypt Tagged Entries… (=app.crypt.encrypt-entries=) | Encrypts every entry with the =crypt= tag (=org-encrypt-entries=). |
11541154| Forget Encryption Passphrase (=app.crypt.forget-passphrase=) | Removes the file's passphrase from the Keychain. |
1155| Show or Hide Outline (=app.toggle-outline=) | Shows or hides the outline pane. View ▸ Show or Hide Outline, =⌥⌘O=. |
1156| Show or Hide Backlinks (=app.toggle-backlinks=) | Shows or hides the backlinks pane. View ▸ Show or Hide Backlinks. |
1157| Show or Hide Columns and Clock (=app.toggle-inspector=) | Shows or hides the columns and clock inspector. View ▸ Show or Hide Columns and Clock, =⌥⌘I=. |
1155| Show or Hide Outline (=app.toggle-outline=) | Shows or hides the outline pane. View ▸ Show Outline, =⌥⌘O=. |
1156| Show or Hide Backlinks (=app.toggle-backlinks=) | Shows or hides the backlinks pane. View ▸ Show Backlinks. |
1157| Show or Hide Columns and Clock (=app.toggle-inspector=) | Shows or hides the columns and clock inspector. View ▸ Show Columns and Clock, =⌥⌘I=. |
11581158| Show or Hide Markup (=app.toggle-markup=) | Shows or hides link brackets and emphasis markers. View ▸ Show Markup, =⇧⌘M=. |
11591159| Show or Hide Line Numbers (=app.toggle-line-numbers=) | Shows or hides line numbers. View ▸ Show Line Numbers, =⇧⌘L=. |
11601160| Show or Hide Tab Bar (=app.toggle-tab-bar=) | Shows or hides the tab bar. View ▸ Show Tab Bar. |
docs/manual/guide/04-outlines.org +2 −2 · view
@@ -703,7 +703,7 @@ for the value with the allowed values listed, Previous Value and Next Value (=p=
703703
704704** The Columns inspector
705705
706View ▸ Show or Hide Columns and Clock opens an inspector beside the editor. Its Columns
706View ▸ Show Columns and Clock opens an inspector beside the editor. Its Columns
707707tab shows the same table for the open file, kept current as you type. Choose File for
708708every entry or Subtree for the entry at the caret. The row of the heading at the caret
709709is shown in bold, and clicking a row goes to it. The Clock tab is described in
@@ -960,7 +960,7 @@ The outline pane, to the left of the editor, lists the headings of the open org
960960indented by level. Click a heading to go to it; folded text around it opens. A heading
961961with no title is shown as =(untitled)=.
962962
963Show or hide it with the toolbar button or View ▸ Show or Hide Outline. orgstar
963Show or hide it with the toolbar button or View ▸ Show Outline. orgstar
964964remembers the choice for org files; for other files the pane starts hidden and shows
965965"Only org files have an outline." Drag the divider to resize it. While the search field
966966has text, the pane shows search results instead. The backlinks pane, when shown, sits
docs/manual/guide/06-dates-and-clocking.org +1 −1 · view
@@ -417,7 +417,7 @@ A line of the form ~CLOCK: => 1:15~, with only a duration, counts towards clock
417417
418418** The inspector
419419
420View ▸ Show or Hide Columns and Clock opens the inspector beside the editor. Its Clock tab lists the clocked time per heading in the open file for Today, This Week (weeks start on Monday) or All, with a total. Clicking a heading moves to it. Only finished clocks count.
420View ▸ Show Columns and Clock opens the inspector beside the editor. Its Clock tab lists the clocked time per heading in the open file for Today, This Week (weeks start on Monday) or All, with a total. Clicking a heading moves to it. Only finished clocks count.
421421
422422** The clock report window
423423
docs/manual/guide/09-links.org +1 −1 · view
@@ -292,7 +292,7 @@ When a key is defined twice, the first definition wins.
292292
293293* The backlinks pane
294294
295View ▸ Show or Hide Backlinks shows a pane under the outline pane of an org file. It
295View ▸ Show Backlinks shows a pane under the outline pane of an org file. It
296296has two sections:
297297
298298- *Links to* the heading at the caret, named after that heading.
docs/manual/guide/13-configuration.org +3 −3 · view
@@ -92,7 +92,7 @@ The two "Emacs hides" and "Emacs shows" switches describe your Emacs, not orgsta
9292
9393The Tags picker offers two values. =config.toml= accepts any integer; with a value other than =-77= or =0= the picker shows no selection.
9494
95The long-lines switch applies to files as they open; View ▸ Truncate or Wrap Long Lines switches the file in front.
95The long-lines switch applies to files as they open; View ▸ Truncate Long Lines switches the file in front.
9696
9797Default TODO keywords apply to files without a =#+TODO= line. orgstar reads them at launch, so a change takes effect after you quit and reopen orgstar.
9898
@@ -239,7 +239,7 @@ A key you remove from the file goes back to its default. A key that isn't in the
239239| =org-tags-exclude-from-inheritance= | string | =""= | Tags that never inherit, separated by spaces. Read at launch. Mirrors =org-tags-exclude-from-inheritance=. |
240240| =org-tag-alist= | string | =""= | The tags Set Tags offers in files without =#+TAGS=, in =#+TAGS= syntax with keys and groups, rows separated by =\n=. Mirrors =org-tag-alist=. |
241241| =org-track-ordered-property-with-tag= | string | ="nil"= | A tag that Toggle ORDERED Property adds and removes with the property: ="t"= for the tag =ORDERED=, or a tag name. Mirrors =org-track-ordered-property-with-tag=. |
242| =auto-fill-mode= | boolean | =false= | Typing a space past =fill-column= breaks the line. View ▸ Turn Auto Fill On or Off changes it for one buffer. Mirrors =auto-fill-mode= in =org-mode-hook=. |
242| =auto-fill-mode= | boolean | =false= | Typing a space past =fill-column= breaks the line. View ▸ Auto Fill changes it for one buffer. Mirrors =auto-fill-mode= in =org-mode-hook=. |
243243| =org-roam-directory= | string | =""= | The folder org-roam notes are in; empty for the first sidebar folder. Mirrors =org-roam-directory=. |
244244| =org-roam-dailies-directory= | string | ="daily/"= | The folder daily notes are in, relative to =org-roam-directory=. Mirrors =org-roam-dailies-directory=. |
245245| =org-roam-dailies-file= | string | ="%<%Y-%m-%d>.org"= | A daily note's file name; =%<…>= formats its date. |
@@ -832,6 +832,6 @@ By default the editor uses one font for everything: body text, headings, code an
832832- =font-size= is the body size, at least 6 points.
833833- Headings are bold. Level 1 is =font-size= plus three times =heading-size-step=, level 2 plus two times, level 3 plus one time; level 4 and deeper are body size. Set =heading-size-step = 0= for one size throughout.
834834- =line-spacing= adds space between lines, in points.
835- =text-width= keeps lines of text to that many columns of =font= in a wider editor, with equal margins either side and the line numbers beside the text, as =olivetti-mode= does in Emacs. Long lines wrap at it; with lines truncated (View ▸ Truncate or Wrap Long Lines) the text takes the whole width. It changes only the display: =M-q= still fills to =fill-column=.
835- =text-width= keeps lines of text to that many columns of =font= in a wider editor, with equal margins either side and the line numbers beside the text, as =olivetti-mode= does in Emacs. Long lines wrap at it; with lines truncated (View ▸ Truncate Long Lines) the text takes the whole width. It changes only the display: =M-q= still fills to =fill-column=.
836836
837837On iPhone and iPad, the editor and reader use the same theme, read from the synced configuration folder. =font= and =body-font= apply when the family is installed on the device, otherwise the system's monospaced font is used, and =font-size= is the size at the default Dynamic Type setting, scaled with the size chosen on the device. The =selection= color, the =cursor= color and the =syntax-*= colors apply there too. See [[file:14-ios.org][iPhone and iPad]].
l10n/Localizable.xcstrings +70 · view
@@ -4418,6 +4418,41 @@
44184418 }
44194419 }
44204420 },
4421 "Auto Fill": {
4422 "comment": "View menu toggle (auto-fill-mode)",
4423 "localizations": {
4424 "de": {
4425 "stringUnit": {
4426 "state": "translated",
4427 "value": "Automatischer Umbruch"
4428 }
4429 },
4430 "es": {
4431 "stringUnit": {
4432 "state": "translated",
4433 "value": "Relleno automático"
4434 }
4435 },
4436 "fr": {
4437 "stringUnit": {
4438 "state": "translated",
4439 "value": "Remplissage automatique"
4440 }
4441 },
4442 "ja": {
4443 "stringUnit": {
4444 "state": "translated",
4445 "value": "自動折り返し"
4446 }
4447 },
4448 "pt-BR": {
4449 "stringUnit": {
4450 "state": "translated",
4451 "value": "Preenchimento Automático"
4452 }
4453 }
4454 }
4455 },
44214456 "Automatically, when typing stops": {
44224457 "localizations": {
44234458 "de": {
@@ -35001,6 +35036,41 @@
3500135036 }
3500235037 }
3500335038 },
35039 "Truncate Long Lines": {
35040 "comment": "View menu toggle",
35041 "localizations": {
35042 "de": {
35043 "stringUnit": {
35044 "state": "translated",
35045 "value": "Lange Zeilen abschneiden"
35046 }
35047 },
35048 "es": {
35049 "stringUnit": {
35050 "state": "translated",
35051 "value": "Truncar líneas largas"
35052 }
35053 },
35054 "fr": {
35055 "stringUnit": {
35056 "state": "translated",
35057 "value": "Tronquer les lignes longues"
35058 }
35059 },
35060 "ja": {
35061 "stringUnit": {
35062 "state": "translated",
35063 "value": "長い行を切り詰める"
35064 }
35065 },
35066 "pt-BR": {
35067 "stringUnit": {
35068 "state": "translated",
35069 "value": "Truncar Linhas Longas"
35070 }
35071 }
35072 }
35073 },
3500435074 "Truncate or Wrap Long Lines": {
3500535075 "comment": "Command title",
3500635076 "localizations": {
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