Truncate long lines from the View menu and Settings !168

merged merged by cmc on 2026-10-08 05:34 UTC · krz/orgstar:truncate-lines-ui into main

3 files changed, +16 −6

Layout: unified · split

Sources/Orgstar/OrgstarApp.swift +9 −1
@@ -356,6 +356,7 @@ struct OrgstarApp: App {
356356 Button("Show or Hide Columns and Clock") { commands.run("app.toggle-inspector") }
357357 .keyboardShortcut("i", modifiers: [.command, .option])
358358 MarkupToggle()
359 Button("Truncate or Wrap Long Lines") { commands.run("editor.toggle-truncate-lines") }
359360 }
360361 CommandGroup(after: .pasteboard) {
361362 Divider()
@@ -480,6 +481,7 @@ struct SettingsView: View {
480481 @AppStorage("fillColumn") private var fillColumn = 80
481482 @AppStorage("hiddenMarkers") private var hiddenMarkers = true
482483 @AppStorage("prettyEntities") private var prettyEntities = true
484 @AppStorage("startupTruncated") private var startupTruncated = false
483485 @AppStorage("todoKeywords") private var todoKeywords = Preferences.defaultTodoKeywords
484486 @AppStorage("agendaSpan") private var agendaSpan = 10
485487 @AppStorage("agendaStartOffset") private var agendaStartOffset = -3
@@ -573,6 +575,12 @@ struct SettingsView: View {
573575 Toggle("Lists can use letters (a. b. c.)", isOn: $alphabeticalLists)
574576 Stepper("M-q fills to column \(fillColumn)", value: $fillColumn, in: 40...200)
575577 }
578 Section {
579 Toggle("Long lines run off the edge instead of wrapping (org-startup-truncated)", isOn: $startupTruncated)
580 } footer: {
581 Text("Applies to files as they open. View ▸ Truncate or Wrap Long Lines switches the current file.")
582 .settingsFooter()
583 }
576584 Section {
577585 Toggle("Emacs hides emphasis markers (org-hide-emphasis-markers)", isOn: $hiddenMarkers)
578586 Toggle("Emacs shows entities as characters (org-pretty-entities)", isOn: $prettyEntities)
@@ -588,7 +596,7 @@ struct SettingsView: View {
588596 }
589597 }
590598 .formStyle(.grouped)
591 .frame(height: 450)
599 .frame(height: 520)
592600 }
593601
594602 private var appearance: some View {
docs/manual/guide/02-the-editor.org +4 −4
@@ -260,15 +260,15 @@ On iOS, spell checking follows =spell-check= in the synced =config.toml=, and is
260260
261261* Wrapping and filling
262262
263Long lines wrap at the edge of the editor by default. 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.
263Long 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.
264264
265265| Preset | Key |
266266|--------+------------------------------|
267267| Emacs | =C-x x t= |
268268| Doom | =SPC t w= in normal state |
269| Mac | palette only |
269| Mac | menu or palette only |
270270
271To truncate lines in every file, set =org-startup-truncated = true= in =config.toml=. The default is to wrap, as Doom does; Emacs's own default is to truncate.
271To truncate lines in every file, turn on Settings ▸ Editing ▸ "Long lines run off the edge instead of wrapping", or set =org-startup-truncated = true= in =config.toml=. The default is to wrap, as Doom does; Emacs's own default is to truncate.
272272
273273Wrapping 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=. Orgstar has no auto-fill: lines are not broken as you type.
274274
@@ -280,7 +280,7 @@ Wrapping is display only. To rewrap the text of a paragraph, use Org ▸ Fill Pa
280280| Show Line Numbers | View ▸ Show Line Numbers | =⇧⌘L= | on | =display-line-numbers-type= | every buffer |
281281| Inline images | Org ▸ Show or Hide Inline Images | =C-c C-x C-v= (Emacs, Doom) | off | =org-startup-with-inline-images= | current buffer |
282282| Spell checking | palette | =SPC t s= (Doom) | off | =spell-check= | current buffer |
283| Truncate long lines | palette | =C-x x t= (Emacs), =SPC t w= (Doom) | off | =org-startup-truncated= | current buffer |
283| Truncate long lines | View ▸ Truncate or Wrap Long Lines | =C-x x t= (Emacs), =SPC t w= (Doom) | off | =org-startup-truncated= | current buffer |
284284
285285Toggles 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.
286286
docs/manual/guide/13-configuration.org +3 −1
@@ -71,6 +71,7 @@ Automatic saving writes a file one second after you stop typing. The keymap pres
7171| M-RET splits the line at the caret | On or off | Off | =org-M-RET-may-split-line= |
7272| Lists can use letters (a. b. c.) | On or off | On | =org-list-allow-alphabetical= |
7373| M-q fills to column N | 40 to 200 | 80 | =fill-column= |
74| Long lines run off the edge instead of wrapping (org-startup-truncated) | On or off | Off | =org-startup-truncated= |
7475| Emacs hides emphasis markers (org-hide-emphasis-markers) | On or off | On | =org-hide-emphasis-markers= |
7576| Emacs shows entities as characters (org-pretty-entities) | On or off | On | =org-pretty-entities= |
7677| Default TODO keywords | Text in =#+TODO= syntax, one sequence per line | See below | =org-todo-keywords= |
@@ -79,6 +80,8 @@ The two "Emacs hides" and "Emacs shows" switches describe your Emacs, not Orgsta
7980
8081The Tags picker offers two values. =config.toml= accepts any integer; with a value other than =-77= or =0= the picker shows no selection.
8182
83The long-lines switch applies to files as they open; View ▸ Truncate or Wrap Long Lines switches the file in front.
84
8285Default 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.
8386
8487** Appearance
@@ -127,7 +130,6 @@ These settings have no control in the Settings window. Some are in the View menu
127130| =org-startup-indented= | |
128131| =org-hide-leading-stars= | |
129132| =org-startup-align-all-tables= | |
130| =org-startup-truncated= | |
131133| =org-startup-with-inline-images= | |
132134| =org-cycle-hide-drawer-startup= | |
133135| =org-cycle-hide-block-startup= | |