dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.57k stars 1.44k forks source link

Global plugin toggle does not affect its children #4542

Closed xave closed 1 year ago

xave commented 1 year ago

Information

VIM version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jan 01 1980 00:00:00) macOS version - arm64

Operating System: MacOS 12.6.3 Monterey

What went wrong

I toggled the plugin off with let g:ale_enabled = 0 " Turn off the plugin

I would expect that this means settings like :

let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1

would respect the global. They do not.

Reproducing the bug

let g:ale_enabled = 0 
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
  1. Source vimrc. :so % from inside vimrc. Close vimrc.

  2. No other instances of vim (Also, would be nice to know if that matters)

  3. Open a new vim.

  4. Open the code file. Save.

It reformats it.

:ALEInfo

``` let g:ale_echo_cursor = 1 let g:ale_echo_msg_error_str = 'Error' let g:ale_echo_msg_format = '%code: %%s' 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 = 0 let g:ale_fixers = {} let g:ale_history_enabled = 1 let g:ale_history_log_output = 1 let g:ale_keep_list_window_open = 0 let g:ale_lint_delay = 200 let g:ale_lint_on_enter = 1 let g:ale_lint_on_filetype_changed = 1 let g:ale_lint_on_insert_leave = 1 let g:ale_lint_on_save = 1 let g:ale_lint_on_text_changed = 'normal' let g:ale_linter_aliases = {} let g:ale_linters = {} let g:ale_linters_explicit = 0 let g:ale_linters_ignore = {} ```

You can see that even though my vimrc has let g:ale_enabled = 0 " Turn off the plugin, my ALEInfo still tries to set it. There is no where else in my vimrc that has g:ale_enabled but this one spot (verified with a grep).

w0rp commented 1 year ago

The documentation explains this. ale_enabled controls only linting.