Skip to content

Context Peek doesn't work on first attempt #148

@nullromo

Description

@nullromo

I use this for my context.nvim config

{
    'wellle/context.vim',
    init = function()
        -- Turn off by default
        vim.g.context_enabled = 0
        vim.g.context_highlight_tag = '<hide>'
    end,
    config = function()
        -- Create a command to peek at the current context
        vim.api.nvim_create_user_command(
            'Context',
            'normal :ContextPeek<CR>',
            { bang = true, desc = 'Context peek' }
        )
    end,
    cmd = 'Context',
}

When I call :Context, I expect to see the context peek window appear. However, on the very first time I call it, the window flickers briefly and then goes away. See the video below. The capture is not good enough to see the flicker, but basically the peek comes up for a tiny fraction of a second. So it's working, but then it gets closed straight away.

Recording.2024-10-01.111250.mp4

Every subsequent call to :Context works. I can't exactly figure out when this occurs, but it seems like it happens on every new buffer. But I think sometimes it also happens within the same buffer if I scroll around.

Any idea what could be causing this?

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