summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-12 23:19:26 +0000
committerw0rp <devw0rp@gmail.com>2017-11-12 23:19:26 +0000
commit70623ca8a7ffadac0d282b4737dbb7322659c592 (patch)
treedb71facbb77c0bbb67ae2b73033b62f67d0acec5 /autoload
parent7d056b0839a6d716533bce73cd72555aec6f5837 (diff)
downloadale-70623ca8a7ffadac0d282b4737dbb7322659c592.zip
Add support for showing Info severities in echoed messages
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/cursor.vim12
1 files changed, 8 insertions, 4 deletions
diff --git a/autoload/ale/cursor.vim b/autoload/ale/cursor.vim
index 6238b4a9..c7c74c9b 100644
--- a/autoload/ale/cursor.vim
+++ b/autoload/ale/cursor.vim
@@ -7,12 +7,16 @@ let s:last_pos = [0, 0, 0]
" Return a formatted message according to g:ale_echo_msg_format variable
function! s:GetMessage(linter, type, text) abort
let l:msg = g:ale_echo_msg_format
- let l:type = a:type is# 'E'
- \ ? g:ale_echo_msg_error_str
- \ : g:ale_echo_msg_warning_str
+ let l:severity = g:ale_echo_msg_warning_str
+
+ if a:type is# 'E'
+ let l:severity = g:ale_echo_msg_error_str
+ elseif a:type is# 'I'
+ let l:severity = g:ale_echo_msg_info_str
+ endif
" Replace handlers if they exist
- for [l:k, l:v] in items({'linter': a:linter, 'severity': l:type})
+ for [l:k, l:v] in items({'linter': a:linter, 'severity': l:severity})
let l:msg = substitute(l:msg, '\V%' . l:k . '%', l:v, '')
endfor