如何防止 VS Code 折叠尾随空行?

Yak*_*ovL 6 visual-studio-code vscode-settings

我有以以下方式使用代码编辑器进行笔记的习惯:

a topic
. a note
 ? a question regarding the note
  - a to do item
 . some more details
. another note
 . more details

another topic
...
Run Code Online (Sandbox Code Playgroud)

我喜欢 VS Code 的一点是它允许根据缩进(例如 Python)折叠(折叠)txt 文件中的块:

  a topic
+ . a note
  . another note
   . more details

  another topic
  ...
Run Code Online (Sandbox Code Playgroud)

不过,我不喜欢的是,它还在折叠块中包含空行:后面的行. more details没有缩进,但是当我折叠该块时,我得到

  a topic
+ . a note
+ . another note
  another topic
  ...
Run Code Online (Sandbox Code Playgroud)

虽然我希望它是

  a topic
+ . a note
+ . another note

  another topic
  ...
Run Code Online (Sandbox Code Playgroud)

你能建议我应该改变哪些选项来获得这种关于折叠的差异吗?

nbp*_*pp2 1

我不知道有什么方法可以防止最后一行在 VS Code 中折叠,除非您使用第三方扩展。

如果您搜索“折叠”的扩展程序,您应该会看到几个。显式折叠似乎有控制此功能的选项。但还有更多。看一看,看看是否符合您的需求。如果没有,那么获得此结果的唯一方法是开发一个扩展来按照您想要的方式处理此问题。