Friday, October 1, 2010

Re: jumping to errors in non-existent files

On Fri, 1 Oct 2010, Karthick Gururaj wrote:

> On Fri, Oct 1, 2010 at 7:30 PM, Jeff Perry wrote:
>>
>> When I run my program from within vim
>>
>>      :./xyz
>>
>> and the program errors out with a runtime error, e.g.:
>>
>>     myprog: myprog.cpp:123: assertion 'x==1' failed
>>
>> vim tries to interpret the the output and jump to the offending line
>> number.
>>
>> The problem is that in the example above it incorrectly interprets
>> the filename as "myprog: myprog.cpp", so it opens a file with that
>> name, which doesn't exist, and then tries to jump to line 123 in that
>> non-existent file.
>>
>> My question is:  Where in vim is this behaviour specified and how can
>> I tweak it to do the right thing?
>
> See :help errorformat
>
> Try,
> :set efm=%*[^\ ]%f:%l:%m
>

So, that addresses one aspect of the problem. But I want to ask: is
it ever useful to have quickfix jump to an error in a nonexistent file
in the first place?

And if there's not a good use case for it, can this be changed at a
lower level? If quickfix is told to open a file that doesn't exist,
throw an error, instead of trying to open it.

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment