0

When I upgrade neovim 0.8.3 to 0.9.0, the plugin https://github.com/junnplus/lsp-setup.nvim diagnostic message disappears when the content is entered in insert mode. after exiting insert mode, the diagnostic message appears again, causing the number line to keep resizing.

set numberwith=6 number line will not change the width constantly, but it will appear again when it exceeds 1000 lines

Is this a bug? how to keep the diagnostic message in insert mode?

insert mode and input ';':

enter image description here

exit insert mode, show diagnostic message, numberwidth changed

enter image description here

the plugin config:

return {
    'junnplus/lsp-setup.nvim',
    event = 'BufRead',
    dependencies = {
        'neovim/nvim-lspconfig',
        'williamboman/mason.nvim',
        'williamboman/mason-lspconfig.nvim',
        'folke/neodev.nvim'
    },
    init = function()
        local rounded = { border = 'rounded' }
        vim.diagnostic.config({ float = rounded })
        vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, rounded)
        vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, rounded)
    end,
    opts = {
        mappings = {
            gd = function() require('telescope.builtin').lsp_definitions() end,
            gi = function() require('telescope.builtin').lsp_implementations() end,
            gr = function() require('telescope.builtin').lsp_references() end,
            ['<space>f'] = vim.lsp.buf.format,
        },
        servers = {
            eslint = {},
            pylsp = {},
            lua_ls = {
                settings = {
                    Lua = {
                        workspace = {
                            checkThirdParty = false,
                        }
                    }
                }
            },
        }
    },
}
5
  • 1
    I'm not sure I understand what you mean by diagnostic message. It would be helpful if you could tell us which plugin is responsible for the message (ALE, coc.nvim, cmp.nvim, ...). It would also be help full if you could provide a short script that highlight the problem together with a screenshot. May 9 at 6:47
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – D. Ben Knoble
    May 9 at 12:21
  • Thanks for the screenshots and the script. But we would also need to know what Lua warning message you are using (coc.nvim, ALE, cmp.nvim)? May 9 at 12:31
  • the gitsigns plugin has same problem github.com/lewis6991/gitsigns.nvim
    – sharp
    May 9 at 12:56
  • Looks like a bug that need to be discussed with Neovim development team. Maybe could you report the issue to the issue section of the corresponding GitHub project. May 9 at 13:10

1 Answer 1

0

Try using this config.

vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
  vim.lsp.diagnostic.on_publish_diagnostics, {
    -- delay update diagnostics
    update_in_insert = true,
  }
)

This will get it updating on insert and stop the annoying line movements.

1
  • Welcome to Vi and Vim! Please consider editing your answer to add additional explanation to your code, perhaps by pointing to the relevant documentation?
    – D. Ben Knoble
    May 21 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.