<commit_before>scriptencoding utf8
" Author: w0rp <<EMAIL>>
" Description: Draws error and warning signs into signcolumn

let b:dummy_sign_set_map = {}

if !hlexists('ALEErrorSign')
    highlight link ALEErrorSign error
endif

if !hlexists('ALEStyleErrorSign')
    highlight link ALEStyleErrorSign ALEErrorSign
endif

if !hlexists('ALEWarningSign')
    highlight link ALEWarningSign todo
endif

if !hlexists('ALEStyleWarningSign')
    highlight link ALEStyleWarningSign ALEWarningSign
endif

if !hlexists('ALEInfoSign')
    highlight link ALEInfoSign ALEWarningSign
endif

if !hlexists('ALESignColumnWithErrors')
    highlight link ALESignColumnWithErrors error
endif

if !hlexists('ALESignColumnWithoutErrors')
    function! s:SetSignColumnWithoutErrorsHighlight() abort
        redir => l:output
            silent highlight SignColumn
        redir end

        let l:highlight_syntax = join(split(l:output)[2:])

        let l:match = matchlist(l:highlight_syntax, '\vlinks to (.+)$')

        if !empty(l:match)
            execute 'highlight link ALESignColumnWithoutErrors ' . l:match[1]
        else
            execute 'highlight ALESignColumnWithoutErrors ' . l:highlight_syntax
        endif
    endfunction

    call s:SetSignColumnWithoutErrorsHighlight()
    delfunction s:SetSignColumnWithoutErrorsHighlight
endif

" Signs show up on the left for error markers.
execute 'sign define ALEErrorSign text=' . g:ale_sign_error
\   . ' texthl=ALEErrorSign linehl=ALEErrorLine'
execute 'sign define ALEStyleErrorSign text=' . g:ale_sign_style_error
\   . ' texthl=ALEStyleErrorSign linehl=ALEStyleErrorSign'
execute 'sign define ALEWarningSign text=' . g:ale_sign_warning
\   . ' texthl=ALEWarningSign linehl=ALEWarningLine'
execute 'sign define ALEStyleWarningSign text=' . g:ale_sign_style_warning
\   . ' texthl=ALEStyleWarningSign linehl=ALEStyleWarningSign'
execute 'sign define ALEInfoSign text=' . g:ale_sign_info
\   . ' texthl=ALEInfoSign linehl=ALEInfoLine'
sign define ALEDummySign

" Read sign data for a buffer to a list of lines.<commit_msg>#572 Handle cleared SignColumn highlights too<commit_after>scriptencoding utf8
" Author: w0rp <<EMAIL>>
" Description: Draws error and warning signs into signcolumn

let b:dummy_sign_set_map = {}

if !hlexists('ALEErrorSign')
    highlight link ALEErrorSign error
endif

if !hlexists('ALEStyleErrorSign')
    highlight link ALEStyleErrorSign ALEErrorSign
endif

if !hlexists('ALEWarningSign')
    highlight link ALEWarningSign todo
endif

if !hlexists('ALEStyleWarningSign')
    highlight link ALEStyleWarningSign ALEWarningSign
endif

if !hlexists('ALEInfoSign')
    highlight link ALEInfoSign ALEWarningSign
endif

if !hlexists('ALESignColumnWithErrors')
    highlight link ALESignColumnWithErrors error
endif

if !hlexists('ALESignColumnWithoutErrors')
    function! s:SetSignColumnWithoutErrorsHighlight() abort
        redir => l:output
            silent highlight SignColumn
        redir end

        let l:highlight_syntax = join(split(l:output)[2:])

        let l:match = matchlist(l:highlight_syntax, '\vlinks to (.+)$')

        if !empty(l:match)
            execute 'highlight link ALESignColumnWithoutErrors ' . l:match[1]
        elseif l:highlight_syntax !=# 'cleared'
            execute 'highlight ALESignColumnWithoutErrors ' . l:highlight_syntax
        endif
    endfunction

    call s:SetSignColumnWithoutErrorsHighlight()
    delfunction s:SetSignColumnWithoutErrorsHighlight
endif

" Signs show up on the left for error markers.
execute 'sign define ALEErrorSign text=' . g:ale_sign_error
\   . ' texthl=ALEErrorSign linehl=ALEErrorLine'
execute 'sign define ALEStyleErrorSign text=' . g:ale_sign_style_error
\   . ' texthl=ALEStyleErrorSign linehl=ALEStyleErrorSign'
execute 'sign define ALEWarningSign text=' . g:ale_sign_warning
\   . ' texthl=ALEWarningSign linehl=ALEWarningLine'
execute 'sign define ALEStyleWarningSign text=' . g:ale_sign_style_warning
\   . ' texthl=ALEStyleWarningSign linehl=ALEStyleWarningSign'
execute 'sign define ALEInfoSign text=' . g:ale_sign_info
\   . ' texthl=ALEInfoSign linehl=ALEInfoLine'
sign define ALEDummySign

" Read sign data for a buffer to a list of lines.
{'fraction_non_alphanumeric': 0.07703315048891009, 'fraction_numerical': 0.0026234199856904365, 'mean_word_length': 4.614457831325301, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6572929', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1270, 'n_words': 324}