Track the Current Heading in a Long Text Document

To track the current heading in a long text document, pair the heading text with its chapter, level, line, and character offset. In a measured six-chapter Rune Studio sample, the cursor was moved to three identical まとめ headings. Workspace readback matched CH-2 at line 9 and offset 47, CH-4 at line 19 and offset 106, and CH-6 at line 29 and offset 167.

That result verifies cursor destinations and their recorded source locations. Rune Studio’s published documentation also describes an outline that tracks the heading associated with the current position and moves to a heading when you click it. The measured run did not exercise automatic on-screen indicator changes or outline-list clicks. Those visible interactions remain checks for your installed version, and they should not be presented as if the cursor readback had verified them.

Distinguish repeated headings with four fields

Headings such as “Summary,” “Results,” or “Notes” often recur across chapters. If the outline shows the same label three times, text alone does not identify one destination. Record at least four fields.

Chapter Level Exact heading Line and offset
CH-2 H2 まとめ line 9, offset 47
CH-4 H2 まとめ line 19, offset 106
CH-6 H2 まとめ line 29, offset 167

The sample contains six chapter headings, twelve H2 headings, and these three exact Japanese labels. The acceptance rule is simple: when heading text repeats, do not call navigation complete until chapter, line, and offset agree. A nearby unique sentence can serve as a fifth identifier when the interface does not show line or offset information.

Stabilize the source outline first

Before testing navigation, make the source hierarchy coherent. If chapters use H1 and sections use H2, do not jump to H4 merely to change visual size, and do not promote ordinary body text into a heading for emphasis. An outline can only track the structure encoded in the document.

The measured baseline was six chapter headings, twelve H2 headings, and three repeated headings. Recount after adding or deleting a heading. If line numbers shift, extract fresh lines and offsets rather than judging a new document with an old map.

The cursor was moved to all three repeated headings

The measured workflow first inspected the complete outline with lines and offsets. It then fixed the three まとめ destinations shown above.

The cursor was moved to offset 47, and the workspace was reopened for readback. The result was line 9, offset 47, with the exact line ## まとめ in CH-2. The same operation was repeated at offset 106 in CH-4 and offset 167 in CH-6. Both readbacks preserved the requested offset and returned the expected line and heading text.

Destination Requested offset Read-back line Read-back text Result
CH-2 47 9 ## まとめ Match
CH-4 106 19 ## まとめ Match
CH-6 167 29 ## まとめ Match

This goes beyond a static list of heading locations: the cursor was actually moved to each location and the saved workspace state was read back. It establishes a reliable way to distinguish destinations that share the same visible title.

Test the visible outline separately

Rune Studio’s feature documentation says that the outline tab lists headings beginning with #, moves to a heading when selected, and tracks the heading associated with the current position. Use the three measured destinations as expected results when you test the visible interface:

  1. Open a copy of the six-chapter source with the body and outline visible.
  2. Move in the body to CH-2, line 9, and note which まとめ entry appears current.
  3. Move to CH-4, line 19, then CH-6, line 29, and check whether the indication follows the corresponding entry.
  4. Select each repeated heading from the outline and reconcile the body chapter, line, and nearby text with the table.
  5. Repeat at the heading immediately above and below a boundary to see where the current indication changes.

These five steps are your interface test. The measured cursor moves do not prove that the current-heading indicator switched automatically or that an outline click landed correctly. If the interface does not show chapter IDs or line numbers, add a temporary marker immediately below each destination, remove it afterward, and recount the headings.

Recover by checking the body location

If the visible indication and the body seem inconsistent, stop choosing identical labels at random. Return to the chapter, level, line, offset, and nearby sentence. If the source no longer contains six chapter headings and twelve H2 headings, repair or remap the source before judging navigation.

When a destination differs from the table, check that you opened the same document version, refreshed the line map after edits, and matched the nearby text. Interface response speed was not measured, so judge destination accuracy rather than calling the behavior fast or slow.

When this method is useful

A heading map plus cursor readback is useful in novels, manuals, and research drafts that repeat labels across many chapters. A short document with unique headings may not need offsets at all. In a frequently edited shared document, lines move often, so combine chapter ID and nearby unique text with the current line rather than treating the line number as permanent.

The broader principle is to avoid making the highlight itself your only source of truth. A stable source map lets you verify the destination independently when the interface is ambiguous.

Conclusion

Text editor current heading tracking becomes reliable when exact heading text is paired with chapter, level, line, and offset. In the six-chapter, twelve-H2 sample, cursor movement and readback matched all three repeated まとめ destinations: CH-2 at line 9/offset 47, CH-4 at line 19/offset 106, and CH-6 at line 29/offset 167.

Automatic switching of the visible current-heading indicator and outline clicks remain unverified. Test those interactions separately with the three measured destinations as your expected results before relying on them in a long manuscript. Current Mac product information is available on the Rune Studio website.