summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-04-24 23:00:43 +0100
committerw0rp <devw0rp@gmail.com>2017-04-24 23:00:43 +0100
commita25b55b954730b4cce2af358f56d3ba2f663ebf5 (patch)
treed3a876743818ebb93862672fbd17f6e88802266f /autoload
parent3345bf20ca92d75e80bae880030268ae49890f6c (diff)
downloadale-a25b55b954730b4cce2af358f56d3ba2f663ebf5.zip
Fix #469 - Remove Unicode quotes from GCC errors, which cause issues
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/gcc.vim10
1 files changed, 9 insertions, 1 deletions
diff --git a/autoload/ale/handlers/gcc.vim b/autoload/ale/handlers/gcc.vim
index 0755e951..fe941734 100644
--- a/autoload/ale/handlers/gcc.vim
+++ b/autoload/ale/handlers/gcc.vim
@@ -18,6 +18,14 @@ function! s:IsHeaderFile(filename) abort
return a:filename =~? '\v\.(h|hpp)$'
endfunction
+function! s:RemoveUnicodeQuotes(text) abort
+ let l:text = a:text
+ let l:text = substitute(l:text, '[`´‘’]', '''', 'g')
+ let l:text = substitute(l:text, '[“”]', '"', 'g')
+
+ return l:text
+endfunction
+
function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
let l:include_pattern = '\v^(In file included | *)from ([^:]*):(\d+)'
let l:include_lnum = 0
@@ -76,7 +84,7 @@ function! ale#handlers#gcc#HandleGCCFormat(buffer, lines) abort
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
- \ 'text': l:match[5],
+ \ 'text': s:RemoveUnicodeQuotes(l:match[5]),
\})
endif
endfor