Ale: `g:ale_fix_on_save` = 1 does not work while `NERDTree` is open and open a file not in the current directory

Created on 31 Oct 2017  路  4Comments  路  Source: dense-analysis/ale

I add remove_trailing_lines to g:ale_fixers for python and set g:ale_fix_on_save = 1.
If I open a file not exist in the current directory and open NERDTree, g:ale_fix_on_save = 1 not work. If I close the NERDTree or open a file exist in the current directory, It works.

 Current Filetype: python
Available Linters: ['flake8', 'mypy', 'pycodestyle', 'pylint']
  Enabled Linters: ['flake8', 'mypy', 'pylint']
 Linter Variables:
let g:ale_python_flake8_executable = 'flake8'
let g:ale_python_flake8_options = '--ignore E501'
let g:ale_python_flake8_use_global = 0
let g:ale_python_mypy_executable = 'mypy'
let g:ale_python_mypy_options = ''
let g:ale_python_mypy_use_global = 0
let g:ale_python_pylint_executable = 'pylint'
let g:ale_python_pylint_options = '--disable C0301,C0111,C0103'
let g:ale_python_pylint_use_global = 0
 Global Variables:
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%s'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'python': ['autopep8', 'isort', 'remove_trailing_lines', 'trim_whitespace']}
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_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {'go': ['go build', 'gofmt', 'golint', 'go vet']}
let g:ale_open_list = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 1
let g:ale_sign_error = '>>'
let g:ale_sign_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
bug

All 4 comments

I tried opening a bunch of files with NERDTree open, and I can't repeat the bug myself. If anyone has any steps for repeating the bug, maybe with an example project, let me know.

Closed due to inactivity.

I ran into the same problem. Running :ALEFix does work with NERDTree open if called manually.
Let me know if I can get more info about this.

Hi @jmolero I had the same problem

The problem is explained in the readme.

"Note that using a plain List for g:ale_fixers is not supported."

You only need to change it to the multi-line version mentioned in the documentation

Was this page helpful?
0 / 5 - 0 ratings

Related issues

trevordmiller picture trevordmiller  路  3Comments

glepnir picture glepnir  路  3Comments

sublee picture sublee  路  3Comments

trevordmiller picture trevordmiller  路  3Comments

chauncey-garrett picture chauncey-garrett  路  3Comments