micangl / cmp-vimtex

Vimtex source for nvim-cmp.
MIT License
78 stars 5 forks source link

Environment completion completes a brace #24

Closed Dolfost closed 3 months ago

Dolfost commented 3 months ago

Here I tried to explain whats up. Basically I wrote some snippets (\begin snippet) for example, and when the cmp-vimtex completes the environment name it closes the brace. I dont need this brace. Or do I? I just want to know what I am doing wrong.

micangl commented 3 months ago

@Dolfost Because your configuration contains:

vim.g.vimtex_complete_close_braces = true

With regard to the double end braces, you're right: you only need one.

Dolfost commented 3 months ago

@Dolfost Because your configuration contains:

vim.g.vimtex_complete_close_braces = true

With regard to the double end braces, you're right: you only need one.

Unfortunatetly the vim.g.vimtex_complete_close_braces = true does not influence the environment completion.

This is what vimtex docs say about this option:

*g:vimtex_complete_close_braces*
  This option controls whether to append a closing brace after a label or
  a citation has been completed.

  Default value: 0

It does not mention the environments brace completion neither turns it off on practice.

micangl commented 3 months ago

I've tried to add it to my configuration and it does, indeed, add the closing braces to itemize}. Setting it to false prevents this behavior.

Dolfost commented 3 months ago

I've tried to add it to my configuration and it does, indeed, add the closing braces to itemize}. Setting it to false prevents this behavior.

This is strange for me. I tried a hundred times to toggle this option, for me it only removes the braces after cites and refs. There could be something wrong with my nvim setup a guess. I need some time to investigate.