Wednesday, February 19, 2014

errorformat/cexpr bug?

Over the years, I have wasted many hours of my life on trying to write errorformat patterns -- and many times having to give up in defeat. Now, finally, I've managed to trace down a behavior that could explain all those hours of frustration.

The meaning of the errorformat option is so arcane, though, that I cannot know for sure whether this is actually a bug in the implementation or simply the intended behavior. If it's intentional, can someone *please* explain to me why it works like this?


:echo string(&efm)

'%+CXXX,%+EERROR,%+IINFO,%-GYYY'

:cgetexpr ['INFO', 'ERROR', 'XXX']
:echomsg string(getqflist()[0].text) string(getqflist()[1].text)

'INFO' 'ERROR^@XXX'

:cgetexpr ['INFO', 'YYY', 'ERROR', 'XXX']
:echomsg string(getqflist()[0].text) string(getqflist()[1].text)

'INFO' 'ERROR'

:cgetexpr ['INFO', 'YYY', 'ZZZ', 'ERROR', 'XXX']
:echomsg string(getqflist()[0].text) string(getqflist()[1].text) string(getqflist()[2].text)

'INFO' 'ZZZ' 'ERROR^@XXX'

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment