garbas / vim-snipmate

snipMate.vim aims to be a concise vim script that implements some of TextMate's snippets features in Vim.
www.vim.org/scripts/script.php?script_id=2540
2.01k stars 181 forks source link

Conflict with AutoComplPop #292

Closed OurCodeBase closed 1 year ago

OurCodeBase commented 1 year ago

ISSUE

I have installed vim-snipmate and AutoComplPop. Then i did add the given function

fun! GetSnipsInCurrentScope()
    let snips = {}
    for scope in [bufnr('%')] + split(&ft, '\.') + ['_']
      call extend(snips, get(s:snippets, scope, {}), 'keep')
      call extend(snips, get(s:multi_snips, scope, {}), 'keep')
    endfor
    return snips
  endf

to the end of ~/.vim/bundle/vim-snipmate/plugin/snipMate.vim, and add these lines to ~/.vimrc file.

let g:acp_behaviorSnipmateLength=1

I have already added some sh.snippets to ~/.vim/snippets/, when I'm using Tab key it works normally but when i type the first letter of snippet in capital letter ( according to AutoComplPop ) i got this error ;

ERROR

A.

IMG_20230109_120844

B.

IMG_20230109_120901

C.

IMG_20230109_120926

ajzafar commented 1 year ago

@strangecode4u The short of it is that the function ACP provides no longer works with SnipMate (and hasn't for many years apparently). The code that SnipMate uses to pull snippets has changed quite a bit. I may be able to write a new function that works for ACP, but it's going to be fairly low priority. Until then, I guess you'll have to manually trigger snippets like the rest of us. It should be noted that even with such a function, I'm not sure it could be guaranteed to pull all up to date snippets, so there could be situations where you'd need to manually trigger anyway.

OurCodeBase commented 1 year ago

@ajzafar Thanks for your support ❤️. Can you tell me that which version of snipmate will work with these codes and function?

ajzafar commented 1 year ago

@strangecode4u I can't tell you which version broke compatibility. I can tell you the original msanders version should still work.

OurCodeBase commented 1 year ago

@ajzafar Thanks for your support ✌🏻 Sir can you provide your Telegram id ? I need to talk to you..