我正在使用:make
fromvim
并最终跳转到有问题的文件。
最近,至少我注意到gcc 4.6.1
,vim
跳转到不正确的文件/行,因为它转到了第一个报告的行,"In file included from ABC.h|5| 0,"
并且没有名为"In file included from ABC.h"
.
ABC.h
在这种情况下,有一种解决方案可以仅从上述行中提取文件名,但这并不能解决问题,因为有问题的文件仅包含在那里。
通常下一行表示问题出在哪里,这就是我想跳转的地方:
MyDir/FGH.h|56 col 32| error: 'bad bad thing happened here'
Run Code Online (Sandbox Code Playgroud)
中是否有已知的修复方法vim
?
这个错误已在新版本的 Vim 上得到解决:错误报告日志 - #62169。
您可以使用以下设置来解决问题,而无需升级Vim:
set errorformat^=%-GIn\ file\ included\ from\ %f:%l:%c:,%-GIn\ file
\\ included\ from\ %f:%l:%c\\,,%-GIn\ file\ included\ from\ %f
\:%l:%c,%-GIn\ file\ included\ from\ %f:%l
Run Code Online (Sandbox Code Playgroud)
(从最新的 Vim 源代码中提取的设置,来自文件src/option.h)