组织模式折叠将空格视为内容

org-mode folding considers whitespace as content

免责声明:我是组织模式的新手。

在 org-mode 中,我有时会添加额外的空行,以便在展开时更清楚地区分不同的任务。像这样:

** Task 1

*** Subtask 1.1
    text text
*** Subtask 1.2

** Task 2

问题是,当我折叠 'Task 1'(在其行上按 C-tab)时,子任务及其内容被正确折叠,但 'Subtask 1.2' 的内容也被折叠(即,它下面的新行)。

如果我在 'Subtask 1.2' 行时按 C-tab,则会打印消息 'SUBTREE (NO CHILDREN)' 并且 'Subtask 1.2' 是正确的 而不是 折叠.

这正常吗?我能否以某种方式纠正此行为,以便不折叠空内容?

在您的配置文件中使用 (setq org-cycle-separator-lines -1)。 这将修复它。

Documentation:
Number of empty lines needed to keep an empty line between collapsed trees.
If you leave an empty line between the end of a subtree and the following
headline, this empty line is hidden when the subtree is folded.
Org mode will leave (exactly) one empty line visible if the number of
empty lines is equal or larger to the number given in this variable.
So the default 2 means at least 2 empty lines after the end of a subtree
are needed to produce free space between a collapsed subtree and the
following headline.

If the number is negative, and the number of empty lines is at least -N,
all empty lines are shown.