Fix #356 Don't complain about #pragma once in C++ headers

This commit is contained in:
w0rp
2017-04-30 00:30:44 +01:00
parent 2c7d14809d
commit a6cadaabef
2 changed files with 24 additions and 0 deletions

View File

@@ -3,6 +3,8 @@ scriptencoding utf-8
" Description: This file defines a handler function which ought to work for
" any program which outputs errors in the format that GCC uses.
let s:pragma_error = '#pragma once in main file'
function! s:AddIncludedErrors(output, include_lnum, include_lines) abort
if a:include_lnum > 0
call add(a:output, {
@@ -92,6 +94,11 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:include_lines = []
let l:included_filename = ''
if s:IsHeaderFile(bufname(bufnr('')))
\&& l:match[5][:len(s:pragma_error) - 1] ==# s:pragma_error
continue
endif
call add(l:output, {
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,