Vim tries to jump to nonexistent file after :make

后端 未结 3 661
执笔经年
执笔经年 2020-12-20 21:50

I\'m using :make from vim and ending up jumping to the file with issues.

Recently, at least I noticed with gcc 4.6.1, vi

相关标签:
3条回答
  • 2020-12-20 21:54

    The problem is with slight differences in the errorformat required for recent versions of gcc.

    I believe this was mentioned in C++ Lounge (chat) the other day, and an errorformat was posted that supposedly works better. I haven't tested that it does:

    • http://chat.stackoverflow.com/search?q=errorformat&room=10

      errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GInfile 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,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f',%X%*\a[%*\d]: Leaving directory `%f',%D%*\a: Entering directory `%f',%X%*\a: Leaving directory `%f',%DMaking %*\a in %f,%f|%l| %m
      
    0 讨论(0)
  • 2020-12-20 21:56

    This a bug that is solved on new versions of Vim: Bug report logs - #62169.

    You can use the following setting to solve the problem without upgrading 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
    

    (setting extracted from latest Vim source code, from file src/option.h)

    0 讨论(0)
  • 2020-12-20 21:59

    :make! doesn't jump to the first result.

    0 讨论(0)
提交回复
热议问题