如何折叠隐藏的文字?

发布于 2024-09-26 11:10:36 字数 548 浏览 0 评论 0原文

问题如下:

  1. 这是一个普通的 .txt 文件

  2. 我已经启用了隐藏功能并创建了此语法文件:

    设置隐藏级别=3
    syn 区域 cTest 隐藏 start='€£' end='£€'
    hi cTest ctermfg=DarkYellow
    
  3. 我首先写了我想说的内容的摘要/框架,并将其放在 €£ 和 £€ 之间。然后,在同一行中,我按照摘要的指导方针写了一篇较长的文本。整个文件包含许多(> 100)行。

  4. 隐藏功能工作得非常好,除了一点:如果随后的行每行长度为 600 个字符(摘要 120 个,文本 480),并且如果屏幕宽度为 80 个字符,则光标所在的行不是on 将显示 6 条屏幕线以及……对应于隐藏的 120 个字符的空白。

是否有可能打破这个空白(如果我可以这么说的话)?

(除了 Tip #1308 之外,我找不到任何关于隐藏功能的教程,并且 Stack Overflow 不接受“隐藏”标签...)

The problem is as follows:

  1. This is about a plain .txt file

  2. I have enabled the conceal feature and created this syntax file:

    set conceallevel=3
    syn region cTest conceal start='€£' end='£€'
    hi cTest ctermfg=DarkYellow
    
  3. I write first a summary/skeleton of what I want to say, and put it in between €£ and £€. Then, in the same line, I write a lengthier text following the guidelines of the summary. The whole file contains many (>100) lines.

  4. The conceal feature works very nicely, except for one point: if the ensuing lines are each, e.g., 600 characters long (summary 120, text 480), and if the screen is 80 characters wide, the lines the cursor is not on will display 6 screen lines plus… a void corresponding to the hidden 120 characters.

Is it possible to collapse this void (if I may say so)?

(I could not find any tutorial on the conceal feature except the Tip #1308, and the "conceal" tag is not accepted by Stack Overflow...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

℡Ms空城旧梦 2024-10-03 11:10:36

不幸的是,目前还没有办法消除隐藏功能造成的这种空白;显然,隐藏功能的开发非常复杂,需要做出一些妥协才能在 7.3 版本中及时“推出”。

如果有人向 Bram Moolenaar 和/或 Vim 开发者邮件列表提交工作补丁,这个问题可能会在未来的版本中得到修复。

Unfortunately, currently there is no way to eliminate this void created by the conceal feature; apparently the development of the conceal feature was very complicated and involved some compromises to get it "out the door" in time for the 7.3 release.

This may be fixed in a future release if someone submits a working patch to Bram Moolenaar and/or the Vim developers mailing list.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文