tomtom / quickfixsigns_vim

Mark quickfix & location list items with signs
http://www.vim.org/scripts/script.php?script_id=2584
GNU General Public License v3.0
131 stars 13 forks source link

separate signs for warning & error entries in quickfix #42

Closed noscript closed 10 years ago

noscript commented 10 years ago

Is it possible? Right now both type of entries in quickfix share the same sign.

P.S. vim-cuteErrorMarker plugin can do it

noscript commented 10 years ago

I think I'm missing something. I tried to debug s:QflSign(item), it always returns 'QFS_QFL'. This is content of a:item:

{'lnum': 30, 'bufnr': 1, 'col': 6, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ' warning: unused variable ‘a’ [-Wunused-variable]'}
{'lnum': 34, 'bufnr': 1, 'col': 3, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ' error: ‘msg1’ was not declared in this scope'} 

Shouldn't 'type' contains 'W' and 'E'?

tomtom commented 10 years ago

Yes. I guess the &errorformat in use doesn't detect whether it's an error or a warning. If this info is important to you, you should change the &efm used. Which compiler? do you use?

noscript commented 10 years ago

I use gcc, errorformat is default.

I was debugging s:ListSign() from ec55910, at the line get(g:quickfixsign_type_rx, ft, []) the function get() always returns an empty dictionary. I checked vim docs, looks like get() doesn't support regexps for {key} parameter, which is '*' as coming from g:quickfixsign_type_rx.

For example if I explicitly set

let g:quickfixsign_type_rx = {'cpp': [['E', '\c\<error\>'], ['W', '\c\<warning\>']]}

then it works. Sort of good news :)