summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-30 00:30:44 +0100
committerw0rp <devw0rp@gmail.com>2017-04-30 00:31:52 +0100
commita6cadaabef9ed9afa7c75bedd3102bf526ac79f0 (patch)
tree05c4c755b118456ab98af474ae321b6f0042a581 /autoload
parent2c7d14809d5e143af89317461daadd12408bfbd5 (diff)
downloadale-a6cadaabef9ed9afa7c75bedd3102bf526ac79f0.zip
Fix #356 Don't complain about #pragma once in C++ headers
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/gcc.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/autoload/ale/handlers/gcc.vim b/autoload/ale/handlers/gcc.vim
index 75964f72..eb42b27a 100644
--- a/autoload/ale/handlers/gcc.vim
+++ b/autoload/ale/handlers/gcc.vim
@@ -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,