Skip to content

InfoView updates in Insert Mode interfere with other plugins input handling #470

@SephVelut

Description

@SephVelut

I have encountered an issue where nvim-autopairs custom rules (specifically Space expansion and jumping over closing pairs) fail to trigger when the Lean InfoView is open. When the InfoView is closed (or toggled off), nvim-autopairs works perfectly. When the InfoView is open, nvim-autopairs appears to fail silently and falls back to inserting the raw character instead of executing the rule. I do not know why (infoview hogging the thread?).

Turning off Infoview allows autopairs to work correctly. For now I'm doing it by pausing infoview when in Insert Mode.

local lean_group = vim.api.nvim_create_augroup("LeanAutoPause", { clear = true })

vim.api.nvim_create_autocmd("InsertEnter", {
    group = lean_group,
    pattern = "*.lean",
    callback = function()
        local iv = require('lean.infoview').get_current_infoview()
        if iv and iv.info and iv.info.pin then
            iv.info.pin:pause()
        end
    end,
})

vim.api.nvim_create_autocmd("InsertLeave", {
    group = lean_group,
    pattern = "*.lean",
    callback = function()
        local iv = require('lean.infoview').get_current_infoview()
        if iv and iv.info and iv.info.pin then
            iv.info.pin:unpause()
        end
    end,
})

Metadata

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