Last active
August 29, 2015 14:24
-
-
Save marcotrosi/04d6d32cc7a6c5e56d8c to your computer and use it in GitHub Desktop.
Vim - create balloon message text out of lint messages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! LintBalloon() | |
let BalloonText_l = [] | |
" read lint output into a list | |
let LintOutput_l=readfile("project.lnt") | |
" iterate through list | |
for line in LintOutput_l | |
" find the message lines and capture the pure message (here for standard gcc format) | |
let Match_l = matchlist(line, '^' . expand('%:.') . ':' . v:beval_lnum .':\d\+: \(.*\)') | |
if len(Match_l) != 0 " if match | |
" add all matching lines to list | |
call add(BalloonText_l, Match_l[1]) | |
endif | |
endfor | |
return join(BalloonText_l, "\n\n") | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment