Foldmethod=indent 变得混乱
通常来说,这对人类来说是一大福音,但有时 vim 基于缩进的折叠会变得混乱,需要通过 :set Foldmethod=indent
进行重置。症状包括窗口中出现连续的折叠线。
有没有办法避免这种情况发生?只有我吗?
更新
虽然我现在很确定我已经发现了一个错误,但尝试我的错误重现脚本(链接到我的答案)的人的答案将真正回答我的第二个问题。如果有人可以告诉我有关修复这种粗略行为的神秘设置,他们将获得 25 分(假设所述建议以答案的形式表述)。事实上,我想我会等一两天,以确保我不会用非错误报告来困扰 vim 的优秀人员。
Normally a great boon to humanity, on occasion vim's indent-based folding will get confused and need a reset via :set foldmethod=indent
. Symptoms include the appearance of consecutive folded lines in the window.
Is there a way to avoid having this happen? Is it just me?
update
Although I'm pretty sure at this point that I've ID'd a bug, answers from people who try my bug reproduction script (linked to in my answer) will serve to actually answer my second question. And if somebody can tell me about the arcane setting that fixes this sketchy behaviour, they get 25 points (assuming that said advice is phrased in the form of an Answer). Actually I think I'll wait a day or two just to make sure I don't pester the good people of vim with a non-bug report.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经成功地重现了这个错误。
http://gist.github.com/ 提供了一个 vim 脚本,它可以为您的调试乐趣进行有趣的历史重演。 427303。如果某些流氓决定用巴尔扎克引文修改要点,我将链接到当前修订 也是如此。
在这一点上,这似乎很明显是一个错误,所以我将继续报告它。我将在错误报告中引用这篇文章,因此此处报告的任何进一步信息应该对调试器有用。
我正在运行 vim-gnome 软件包,版本为“2:7.2.330-1ubuntu3”。如果我的 vim 安装出现问题,这里是我的脚本创建的“分析”窗口的输出:
编辑
这是一个 已知问题。
I've managed to reproduce this bug.
A vimscript which will conduct an entertaining historical reenactment for your debugging pleasure is available at http://gist.github.com/427303. In case some hooligan decides to revise the gist with Balzac quotations, I'll link to the current revision as well.
At this point it seems to be pretty clearly a bug, so I'll go ahead and report it. I'll reference this post in the bug report, so any further information reported here should be useful to the debuggers.
I'm running the vim-gnome package, version '2:7.2.330-1ubuntu3'. In case something is totally screwy with my vim install, here's the output from the 'analysis' window that my script creates:
edit
This is a known issue.