Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vais opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@vais
Copy link

vais commented Feb 27, 2025

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.

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:

@vais vais added the bug label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant