hrsh7th / nvim-compe

Auto completion Lua plugin for nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ultisnips - When documentation is true and shown, you cannot jump to the next snippet placeholder

baldore opened this issue · comments

Checkhealth

health#compe#check
========================================================================
## compe:snippet
  - OK: snippet engine detected.

## compe:mapping
  - INFO: `compe#complete` is not mapped
  - OK: `compe#confirm` is mapped: (`i  <CR>        * compe#confirm('<CR>')`)
  - INFO: `compe#close` is not mapped
  - INFO: `compe#scroll` is not mapped

Describe the bug

The bug happens when you select one autocomplete option and the documentation tooltip appears. This disables completely current snippet placeholders, making it unusable.

I suspect the problem happens due to the new buffer created for the documentation.

To Reproduce

vimrc
call plug#begin('~/.config/nvim/plugged')

Plug 'SirVer/ultisnips'
Plug 'hrsh7th/nvim-compe'

call plug#end()

set completeopt=menuone,noselect

let g:compe = {}
let g:compe.enabled = v:true
let g:compe.autocomplete = v:true
let g:compe.min_length = 1
let g:compe.preselect = v:false

let g:compe.source = {}
let g:compe.source.path = v:true
let g:compe.source.buffer = v:true
let g:compe.source.ultisnips = v:true
  1. Expand an Ultisnips snippet with multiple placeholders.
  2. Write something to show the autocomplete options and select one option that displays documentation.

Note: It works correctly when documentation is false.

let g:compe.documentation = v:false

Actual behavior

You're unable to jump to the next placeholder, making Ultisnips basically useless.

Expected behavior

It should jump correctly between placeholders.

Screenshots

Documentation enabled

documentation-on

Documentation disabled

documentation-off

Hm... I can't reproduce it.

Kapture.2021-08-07.at.00.47.51.mp4

It happens after the snippet is expanded. For example, when you are inside href="|", select an autocomplete option that shows documentation (like another snippet or lsp function).

Also... I'm starting to think that this could be a Ultisnips bug. After disabling the documentation, I have another plugin that shows a popup and breaks the placeholder jump too. Still, please take a look. I would like to get your opinion about it. Thanks.

Probably, I found the reason. It caused by Ultisnips#ExpandSnippet. If current activated snippet can jumpable, the function would not effect anymore.

I think we can close this... Not a simple solution for now it seems. I found this one on Ultisnips SirVer/ultisnips#1188