Skip to content

Commit ee90acf

Browse files
committed
for #385
1 parent 5721b04 commit ee90acf

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

autoload/easycomplete/sign.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ let s:lint_popup_timer = 0
2020

2121
let g:easycomplete_diagnostics_config = {
2222
\ 'error':
23-
\ {'type': 1, 'prompt_text': s:error_text, 'fg_color': easycomplete#util#IsGui() ? '#FF0000' : 'red' , "hl": 'ErrorMsg'},
23+
\ {'type': 1, 'prompt_text': s:error_text, 'fg_color': easycomplete#util#IsGui() ? easycomplete#ui#DiagColor("error") : 'red' , "hl": 'ErrorMsg'},
2424
\ 'warning':
25-
\ {'type': 2, 'prompt_text': s:waring_text, 'fg_color': easycomplete#util#IsGui() ? '#FFFF00' : 'yellow', "hl": 'WarningMsg'},
25+
\ {'type': 2, 'prompt_text': s:waring_text, 'fg_color': easycomplete#util#IsGui() ? easycomplete#ui#DiagColor("warning") : 'yellow', "hl": 'WarningMsg'},
2626
\ 'information':
27-
\ {'type': 3, 'prompt_text': s:infermation_text,'fg_color': easycomplete#util#IsGui() ? '#5FFFAF' : '85' , "hl": 'Pmenu'},
27+
\ {'type': 3, 'prompt_text': s:infermation_text,'fg_color': easycomplete#util#IsGui() ? easycomplete#ui#DiagColor("information") : '85' , "hl": 'Pmenu'},
2828
\ 'hint':
29-
\ {'type': 4, 'prompt_text': s:hint_text, 'fg_color': easycomplete#util#IsGui() ? '#8787FF' : '99' , "hl": 'Pmenu'}
29+
\ {'type': 4, 'prompt_text': s:hint_text, 'fg_color': easycomplete#util#IsGui() ? easycomplete#ui#DiagColor("hint") : '99' , "hl": 'Pmenu'}
3030
\ }
3131

3232
function! easycomplete#sign#test()

autoload/easycomplete/ui.vim

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,25 @@ function! easycomplete#ui#HiFloatBorder()
195195
endif
196196
endfunction
197197

198+
" error, warning, information, hint
199+
function! easycomplete#ui#DiagColor(str_type)
200+
if a:str_type == "error"
201+
let color = easycomplete#ui#GetFgColor("DiagnosticFloatingError")
202+
if color == "NONE" | let color = "#FF0000" | endif
203+
elseif a:str_type == "warning"
204+
let color = easycomplete#ui#GetFgColor("DiagnosticFloatingWarn")
205+
if color == "NONE" | let color = "#FFFF00" | endif
206+
elseif a:str_type == "information"
207+
let color = easycomplete#ui#GetFgColor("DiagnosticFloatingInfo")
208+
if color == "NONE" | let color = "#5FFFAF" | endif
209+
elseif a:str_type == "hint"
210+
let color = easycomplete#ui#GetFgColor("DiagnosticFloatingHint")
211+
if color == "NONE" | let color = "#8787FF" | endif
212+
endif
213+
return color
214+
endfunction
215+
216+
198217
function! s:IsSearchWord()
199218
if !exists("b:cs_searched")
200219
let b:cs_searched = v:false

0 commit comments

Comments
 (0)