1

Information

VIM version VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Mar 16 2023 00:00:00) Included patches: 1-1407

Operating System: Linux (Fedora 38,Gnome)

What went wrong

From the last update of ALE (through vim-plug) I am getting a permanent warning line after eol of a problematic line, even when my cursor is far from it. Please see the screenshot enter image description here

As you can see, even when my cursor in not around the problem line, I am getting the error/warning msg. I want only the preview window when the cursor is on it. This is happening for python and fortran.

This is my ALE settings:

g:ale_sign_error = ''
g:ale_sign_warning = ''
g:ale_sign_info = ''
highlight ALEErrorSign guibg=#00A56A guifg=#ffffff ctermbg=NONE ctermfg=red
highlight ALEWarningSign guibg=#00A56A guifg=#ffffff  ctermbg=NONE ctermfg=yellow
# let g:ale_set_loclist = 1
# let g:ale_set_quickfix = 0
g:ale_fix_on_save = 1
g:ale_fixers = {
      \ '*': ['remove_trailing_lines', 'trim_whitespace'],
      \ 'tex': ['latexindent', 'remove_trailing_lines', 'trim_whitespace'],
      \ 'python': ['isort', 'yapf'],
      \ 'cpp': ['astyle', 'clangtidy', 'remove_trailing_lines', 'trim_whitespace'],
      \ }
g:ale_linters = {
      \ 'fortran': ['gcc'],
      \ 'tex': ['texlab'],
      \ 'python': ['pycodestyle'],
      \ 'vim': ['vint', '/usr/local/lib/node_modules/vim-language-server/bin/index.js'],
      \ 'cpp': ['ccls'],
      \ }

:ALEInfo

 Current Filetype: python
Available Linters: ['bandit', 'cspell', 'flake8', 'flakehell', 'jedils', 'mypy', 'prospector', 'pycln', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylama', 'pylint', 'pylsp', 'pyre', 'pyright', 'refurb', 'ruff', 'unimport', 'vulture']
  Enabled Linters: ['pycodestyle']
  Ignored Linters: []
 Suggested Fixers: 
  'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.
  'autoflake' - Fix flake issues with autoflake.
  'autoimport' - Fix import issues with autoimport.
  'autopep8' - Fix PEP8 issues with autopep8.
  'black' - Fix PEP8 issues with black.
  'isort' - Sort Python imports with isort.
  'pycln' - remove unused python import statements
  'pyflyby' - Tidy Python imports with pyflyby.
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'reorder-python-imports' - Sort Python imports with reorder-python-imports.
  'ruff' - A python linter/fixer for Python written in Rust
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
  'yapf' - Fix Python files with yapf.
 Linter Variables:

let g:ale_python_auto_pipenv = 0 let g:ale_python_auto_poetry = 0 let g:ale_python_auto_virtualenv = 0 let g:ale_python_pycodestyle_auto_pipenv = 0 let g:ale_python_pycodestyle_auto_poetry = 0 let g:ale_python_pycodestyle_executable = 'pycodestyle' let g:ale_python_pycodestyle_options = '' let g:ale_python_pycodestyle_use_global = 0 Global Variables:

let g:ale_cache_executable_check_failures = v:null let g:ale_change_sign_column_color = 0 let g:ale_command_wrapper = '' 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 = 0 let g:ale_echo_cursor = 0 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 = {'tex': ['latexindent', 'remove_trailing_lines', 'trim_whitespace'], '*': ['remove_trailing_lines', 'trim_whitespace'], 'cpp': ['astyle', 'clangtidy', 'remove_trailing_lines', 'trim_whitespace'], 'python': ['isort', 'yapf']} 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 = {'vim': ['vint', '/usr/local/lib/node_modules/vim-language-server/bin/index.js'], 'tex': ['texlab'], 'cpp': ['ccls'], 'fortran': ['gcc'], 'python': ['pycodestyle']} let g:ale_linters_explicit = 0 let g:ale_linters_ignore = {} let g:ale_list_vertical = 0 let g:ale_list_window_size = 10 let g:ale_loclist_msg_format = '%code: %%s' let g:ale_max_buffer_history_size = 20 let g:ale_max_signs = -1 let g:ale_maximum_file_size = v:null let g:ale_open_list = 0 let g:ale_pattern_options = v:null let g:ale_pattern_options_enabled = v:null let g:ale_root = {} let g:ale_set_balloons = 1 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 = 0 let g:ale_sign_error = '' let g:ale_sign_info = '' let g:ale_sign_offset = 1000000 let g:ale_sign_style_error = '' let g:ale_sign_style_warning = '' let g:ale_sign_warning = '' let g:ale_sign_highlight_linenrs = 0 let g:ale_statusline_format = v:null let g:ale_type_map = {} 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:

(executable check - success) pycodestyle (finished - exit code 1) ['/bin/bash', '-c', '''pycodestyle'' - < ''/tmp/vuFsWop/1/i.py''']

<<<OUTPUT STARTS>>> stdin:1:1: W391 blank line at end of file <<<OUTPUT ENDS>>>

Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37
BaRud
  • 481
  • 2
  • 10

1 Answers1

3

You can change g:ale_virtualtext_cursor:

let g:ale_virtualtext_cursor = 1

More information with: :help g:ale_virtualtext_cursor

Vivian De Smedt
  • 16,336
  • 3
  • 18
  • 37
  • 1
    So the solution was in the doc all along? Incredible. – romainl Mar 19 '23 at 08:29
  • Vimquisitor you are too sarcastic :-) – Vivian De Smedt Mar 19 '23 at 08:54
  • 1
    The documentation is good, but a bit confusing at first. It was not obvious that these comments are called "virtual text". Then :help virtualtext landed me on g:ale_virtualtext_delay and the correct option was described above in the help page, under g:ale_virtualtext_cursor. This question and answer helped me add let g:ale_virtualtext_cursor = 0 to my .vimrc. Thank you. – Paul Rougieux Sep 01 '23 at 12:04