Skip to content

add a way to detect the popup was opened by ctrl-x ctrl-f #4083

@prabirshrestha

Description

@prabirshrestha

In asyncomplete v2 I now provide custom filter function when a character is inputed. Now if the user open file complete using ctrl-x ctrl-f the pum opens but because because of asyncomplete it takes over pum. Can we have an autocmd event that notifies autocomplete plugins that the popup was opened due toctrl-x ctrl-f so we can ignore processing our code and let vim handle the autocomplete?

A bit more info on this can be found at prabirshrestha/asyncomplete.vim#124 (comment)

autocmd CompleteOpen * call s:complete_open()
autocmd CompleteDone * call s:complete_done()

function! s:complete_open() abort
    let s:complete_type = v:event['complete_type']
endfunction

function! s:complete_done() abort
    let s:complete_type = ''
endfunction

function! s:on_changed() abort
    if s:complete_type == 'ctrl-x ctrl-f' || s:complete_type == 'ctrl-x ctrl-o' | return | endif
    " .... asyncomplete s:on_change code goes here
endfunction

Of if anyone has a better way to solve this issue without adding autocmd events let me know.

//cc @mattn Who filed the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions