Ale: Cursor disappears on lines with warnings/errors

Created on 4 Apr 2018  路  7Comments  路  Source: dense-analysis/ale

Information

VIM version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 05 2018 16:15:22)
Included patches: 1-1453

Operating System: Debian buster (testing)

:ALEInfo

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 = ''
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 = ''
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 = 0
let g:ale_fixers = {}
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 = {}
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 = 0
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
Command History:

(executable check - failure) flake8
(executable check - failure) mypy
(executable check - success) pylint
(started) ['/bin/zsh', '-c', '''pylint'' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/home/wpette/vimtest/test.py''']
(executable check - failure) flake8
(executable check - failure) mypy
(finished - exit code 20) ['/bin/zsh', '-c', '''pylint'' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n ''/home/wpette/vimtest/test.py''']

<<>>
*** Module test
test.py:6:0: C0111 (missing-docstring) Missing function docstring
test.py:6:8: W0613 (unused-argument) Unused argument 'thing'


Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)

<<>>

What went wrong

The vim cursor disappears on lines which contain warnings/errors from ALE.

Reproducing the bug

Steps for repeating the bug:

  1. Edit a file which has errors/warnings
  2. Move the cursor onto a line which has warnings/errors.
  3. The cursor disappears. It does not come back until you change lines twice (i.e. press either j twice, or k twice), at which point the cursor is two lines above/below the original line.

I've uploaded a screencast which shows this behaviour to https://asciinema.org/a/q4ECuHsHNTw1DKQk2PrCQI739
I have replicated this with a minimum working example (which is why I'm in ~/vimtest for the screencast), but I still feel like surely this must be a configuration issue on my end, otherwise more people would notice this bug. Any hints on what to look for would be appreciated.

bug duplicate

Most helpful comment

I have the same issue, it appears to be a problem with ale_echo_cursor if I set it to 0 let g:ale_echo_cursor = 0 my cursor no longer disappears when on a line with an error. I don't think this is a terminal issue, as xterm & roxterm display the same behavior. If I enable cursor blinking, the cursor does reappear after some delay, but if I move again on the same line it disappears again and then reappears after the same delay. If I increase ale_echo_delay then the cursor does not disappear until that timer fires.

All 7 comments

It looks like Vim is drawing the error highlight above your cursor. This is probably down to whatever syntax highlighting you are using, causing errors to be drawn so they mask the cursor. For me, the cursor background and foreground colors are such that the cursor is still visible. Try looking at :help ale-highlight for list of all the highlights and the default settings that ALE uses for them, and play around with different highlight colors. You could also try using a different theme for Vim.

I got to playing around with the highlight colors and themes, and they seemed to show the same result, almost always. When trying to nail down exactly what caused it, I started noticing that vim's ruler (the line/column counts in the lower right) were delayed exactly when the vim cursor wasn't showing up. I made yet another video at https://asciinema.org/a/fm2dMzbzdnfWJ8X3XEb9nhVyg which demonstrates the effect. I've tried this exact same setup on my Debian desktop (where I have the issue) as well as on ArchLinux and Gentoo setups, and neither of the latter two display this particular problem. I can't explain why I only see this issue on Debian, unless it's specific to a very particular Vim version (8.0.1453 on Debian exhibits this issue, but 8.0.1298 (Gentoo) is okay and 8.0.1542 (ArchLinux) is okay).

I have no good ideas for going forward, I guess if someone else sees a similar problem we may be able to investigate further but so far this is really just a one-off that even I cannot replicate on another machine.

I have the same issue, it appears to be a problem with ale_echo_cursor if I set it to 0 let g:ale_echo_cursor = 0 my cursor no longer disappears when on a line with an error. I don't think this is a terminal issue, as xterm & roxterm display the same behavior. If I enable cursor blinking, the cursor does reappear after some delay, but if I move again on the same line it disappears again and then reappears after the same delay. If I increase ale_echo_delay then the cursor does not disappear until that timer fires.

I think this problem only happens for a few Vim versions, between particular patches. Try using newer or older Vim versions, and let me know if you have the same issue. I think the latest patches don't have this issue, based on feedback I've received.

There's a newer issue which duplicates this one, but I posted some better information there. I think the version of Vim which comes with recent Ubuntu is broken and needs to be fixed to include more recent patches. See here: #1536

I confirmed that the recent vim version in Ubuntu is broken.
I followed the instruction below to upgrade my vim to 8.1 and everything works fine now.

https://vi.stackexchange.com/questions/10817/how-can-i-get-a-newer-version-of-vim-on-ubuntu

sudo add-apt-repository ppa:jonathonf/vim
sudo apt update
sudo apt install vim

If anyone knows how to contact whoever is responsible for managing the Vim packages for Ubuntu, let them know that they should fix it. "Artful" shouldn't have the bug, "Bionic" should, and "Cosmic" shouldn't. "Bionic" is the LTS release, so I would like it if they could update the package to at least a Vim patch new enough which contains the fix for this. I might try to email someone again myself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

catbaron0 picture catbaron0  路  3Comments

trevordmiller picture trevordmiller  路  3Comments

glepnir picture glepnir  路  3Comments

trevordmiller picture trevordmiller  路  4Comments

sublee picture sublee  路  3Comments