dense-analysis / dense-analysis/ale

ALE-specific highlights get permanently lost when switching between dark and light background

Open
#4,915 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information

**VIM version**

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Feb 21 2025 00:08:16)
macOS version - x86_64

Operating System: MacOS

## What went wrong

When you switch back-and-forth between dark and light background, ALE highlighting of errors in signcolumn and virtual text gets lost, and there is no way to bring it back short of restarting vim (e.g. reapplying the colorscheme, stopping/starting disabling/enabling ALE, etc)

I have added the following to my vimrc, and this **does** fix the issue, but obviously this is not ideal. Hopefully this is a clue to what's going wrong in the plugin.
```vim
function! ReapplyALEHighlights() abort
highlight link ALEErrorSign error
highlight link ALEStyleErrorSign ALEErrorSign
highlight link ALEWarningSign todo
highlight link ALEStyleWarningSign ALEWarningSign
highlight link ALEInfoSign ALEWarningSign
highlight link ALESignColumnWithErrors error
" ...etc. etc., the rest of these things copy/pasted from ALE source code
endfunction

augroup ConfigureColorscheme
autocmd!
autocmd ColorScheme retrobox call ReapplyALEHighlights()
augroup END
```

## Reproducing the bug

1. Have some lint errors in the buffer (signcolumn and/or virtual text)
2. `:set background=light`
3. Observe that both signcolumn and virtualtext are no longer highlighted
4. `:set background=dark`
5. Observe that both signcolumn and virtualtext are no longer highlighted
6. Nothing at this point will bring the highlighting of signcolumn/virtualtext back (other than restarting vim)

### :ALEInfo

Current Filetype: vim
Available Linters: ['ale_custom_linting_rules', 'vimls', 'vint']
Enabled Linters: []
Ignored Linters: []
Suggested Fixers:
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.

Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = v:null
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 'auto'
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = v:null
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'elixir': ['mix_format'], 'typescript': ['prettier'], 'typescriptreact': ['prettier'], 'html': ['prettier'], 'javascript': ['eslint'], 'css': ['prettier'], 'eelixir': ['mix_format']}
let g:ale_history_enabled = 1
let g:ale_info_default_mode = 'preview'
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
let g:ale_lint_on_insert_leave = 0
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 0
let g:ale_linter_aliases = {}
let g:ale_linters = {'elixir': ['elixir-ls'], 'typescript': ['tsserver'], 'typescriptreact': ['tsserver'], 'ruby': ['ruby'], 'javascript': ['eslint', 'tsserver']}
let g:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_max_buffer_history_size = v:null
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 0
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = v:null
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_sign_highlight_linenrs = v:null
let g:ale_type_map = v:null
let g:ale_use_neovim_diagnostics_api = 0
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 'all'
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1

Command History:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.