Skip to content

cmp.core:prepare() is expansive and calls for every InsertEnter #1908

@xzbdmw

Description

@xzbdmw

autocmd.subscribe({ 'InsertEnter' }, async.debounce_next_tick_by_keymap(on_insert_enter))

It calls cmp.core:prepare() for every InsertEnter and it takes 20ms to run that prepare function, which makes o become laggy.
And it is not async as its name suggests, because if you put a heavy loop in on_insert_enter and type o editor will freeze.

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