Skip to content

Diagnostics hover and echo status message hidden by "--No lines in buffer--" #1510

Open
@flwyd

Description

Steps to reproduce:

  • Make sure a Python LSP is installed.
  • echo "foo()\nbar()" > /tmp/foo.py
  • vim -u /tmp/minimal.vim /tmp/foo.py
  • When vim opens, move the cursor and see an error like undefined name 'foo' in a popup window and in the status message. Both the window and the status disappear after a few seconds (maybe 5 seconds after moving the cursor?) and the status message becomes --No lines in buffer--.
  • Expected behavior: diagnostics status message and the floating window stay visible until moving the cursor.

Curiously, if g:lsp_diagnostics_float_delay is 500 instead of 2000 or 1000, the "No lines in buffer" message doesn't show up and the diagnostic status message stays in place, though the hover window still disappears after a few seconds. (Is the floating window supposed to disappear? I'd really like it to stay visible until I move the cursor.) 500 seems to be the magic value; anything larger results in "No lines in buffer" messages overwriting the status line while anything smaller doesn't.

Contents of /tmp/minimal.vim, assumes vim-plug is already installed:

set nocompatible

call plug#begin('~/.vim/plugged')
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
call plug#end()

" Configuration for vim-lsp
let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_diagnostics_float_cursor = 1
let g:lsp_diagnostics_float_delay = 1000
let g:lsp_diagnostics_virtual_text_enabled = 0
let g:lsp_float_max_width = 0

This happens on the system vim for macOS 12.7 (9.0 with patches 1-1544), MacVim 9.0.1897, and a recent gvim on Debian Linux (9.0, don't have the patch list handy). It's not limited to any particular LSP; I've seen it with the Python and Julia LSPs from vim-lsp-settings as well as a company-internal LSP at work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions