@@ -75,6 +75,9 @@ pub struct App {
7575 raw_mode: bool,
7676 /// Long lines wrap in the reading pane and the editor (§10.1); `zw`.
7777 wrap: bool,
78+ /// The reading pane is shown beside the outline (§10.1); `zp`. Hidden,
79+ /// the outline takes the screen and the pane appears only to edit.
80+ pub show_reading: bool,
7881 register: String,
7982 status: String,
8083 status_time: Instant,
@@ -164,6 +167,7 @@ impl App {
164167 hide_done: false,
165168 raw_mode: false,
166169 wrap: true,
170+ show_reading: false,
167171 register: String::new(),
168172 status: "click to select · double-click to zoom · right-click for actions · drag to move · ? help".into(),
169173 status_time: Instant::now(),
@@ -658,6 +662,11 @@ impl App {
658662 self.open_editor_on(target);
659663 }
660664
665+ /// Whether the reading pane is on screen: shown, or holding the editor.
666+ pub fn reading_visible(&self) -> bool {
667+ self.show_reading || self.mode == Mode::Edit
668+ }
669+
661670 /// Open the built-in editor over a node's subtree (§10.6).
662671 fn open_editor_on(&mut self, target: NRef) {
663672 let buf = fold_core::edit::open_editor(&self.vault, target);
@@ -1099,6 +1108,7 @@ impl App {
10991108 }
11001109 ('z', KeyCode::Char('a')) => self.act_archive(),
11011110 ('z', KeyCode::Char('w')) => self.run_action(Action::Wrap),
1111+ ('z', KeyCode::Char('p')) => self.run_action(Action::ReadingPane),
11021112 ('g', KeyCode::Char('g')) => match self.focus {
11031113 Focus::Outline => self.cursor = 0,
11041114 Focus::Reading => self.read_cursor = 0,
@@ -1185,7 +1195,10 @@ impl App {
11851195 }
11861196 _ if ctrl => {}
11871197 KeyCode::Char('q') => self.quit = true,
1188− KeyCode::Tab => self.focus = Focus::Reading,
1198+ KeyCode::Tab => {
1199+ self.show_reading = true;
1200+ self.focus = Focus::Reading;
1201+ }
11891202 KeyCode::Char('j') | KeyCode::Down => {
11901203 if self.cursor + 1 < len {
11911204 self.cursor += 1;
@@ -1788,6 +1801,13 @@ impl App {
17881801 self.clamp_cursor();
17891802 self.say(if self.hide_done { "done hidden" } else { "done shown" });
17901803 }
1804+ Action::ReadingPane => {
1805+ self.show_reading = !self.show_reading;
1806+ if !self.show_reading && self.focus == Focus::Reading {
1807+ self.focus = Focus::Outline;
1808+ }
1809+ self.say(if self.show_reading { "reading pane shown" } else { "reading pane hidden" });
1810+ }
17911811 Action::Wrap => {
17921812 self.wrap = !self.wrap;
17931813 self.say(if self.wrap { "long lines wrap" } else { "long lines are cut at the edge" });
@@ -1862,7 +1882,9 @@ impl App {
18621882 self.cursor = 0;
18631883 self.read_cursor = 0;
18641884 self.scroll_reading = 0;
1865− self.focus = Focus::Reading;
1885+ if self.reading_visible() {
1886+ self.focus = Focus::Reading;
1887+ }
18661888 }
18671889 }
18681890
@@ -1924,7 +1946,7 @@ pub fn help_text() -> Vec<Line<'static>> {
19241946 ("n/N x t", "new sibling / child · done · task on/off"),
19251947 ("J/K > < ~", "move · indent · outdent · heading ↔ bullet"),
19261948 ("r y d p/P", "move to… · copy · delete · paste after / before"),
1927− ("s za zd zr zw", "make block · archive · hide done · raw source · wrap lines"),
1949+ ("s za zd zr zw zp", "make block · archive · hide done · raw source · wrap lines · reading pane"),
19281950 ("/ : ?", "filter · command palette · this help"),
19291951 ("u/U q", "undo / redo · quit (everything is always saved)"),
19301952 ("Tab", "switch panes · in the text: [[ ]] headings, / search, o link"),