lifepillar / vim-mucomplete

Chained completion that works the way you want!
MIT License
911 stars 18 forks source link

Disable on prompt buffers? #196

Closed tssm closed 3 years ago

tssm commented 3 years ago

Vim and Neovim have a prompt type of buffer which is used for getting input from plugins. So far, I've only interacted with it in the context of Telescope, and it seems to me mucomplete shouldn't be enabled on it. Here is how Telescope may look when filtering files.

Screenshot 2021-08-10 at 20 18 43

It is possible to disable it by changing the mucomplete#auto#auto_complete() function:

  fun! mucomplete#auto#auto_complete()
    if &buftype isnot# 'prompt' && s:insertcharpre || mode(1) ==# 'ic'
      let s:insertcharpre = 0
      call mucomplete#auto_complete()
    endif
  endf

But maybe there's a better solution? It may also be the case that I am missing instances where mucomplete makes sense to be enabled on a prompt buffer

lifepillar commented 3 years ago

Use may use autocommand events to enable/disable MUcomplete on a per-buffer basis. See for example https://github.com/lifepillar/vim-mucomplete/issues/173.

tssm commented 3 years ago

Got it, thanks!