-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vimtex support isn't complete #1
Comments
@hrsh7th The offset in this line is wrong: cmp-omni/lua/cmp_omni/init.lua Line 20 in 3fec8a5
offset should be offset + 1 . If the current line says \b for example, only the b has to be passed to the omnifunc. For some characters it still works (e.g. \B ). For @jfab-123 the results displayed are only those items from the buffer / ultisnips.
|
The vimtex omnifunc also provides additional data, e.g. symbols as seen in the picture above, or additional information when using |
I think it's keyword pattern problem. What the keyword pattern did you use? |
Let me illustrate on the example :lua print(vim.inspect(vim.api.nvim_call_function(vim.bo.omnifunc, {0, 'b'})))` with omnifunc begin set to :lua print(vim.inspect(vim.api.nvim_call_function(vim.bo.omnifunc, {0, '\\b'})))` |
Oh my... The omnifunc should reutnr the number that 0-origin indexed... OK. I think it should be +1 value. @jhossbach Is there something wrong? |
I tested with the above example omnifunc. If I return |
With cmp-omni, this works when |
I am unsure, seeing that vimtex seems to work flawlessly with other plugins such as |
I've fixed the offset problem. Thank you very much. |
At least, the html omnifunc is worked fine with this fix. |
Great, glad to help! On a side note, vimtex provides a lot of additional data that is currently not displayed in nvim-cmp. Can we add that to the list of items to show? Or should we add another source explicitly for vimtex? See this comment: lervag/vimtex#2215 (comment) |
I think this works for me! |
@jhossbach I've added the |
Ah, very nice, I did not know about |
Is it possible to format the menu of nvim-cmp, without loosing the additional information provided by vimtex? I've followed the steps described here to customize my menu with lspicons. At the moment my
In my menu appears |
When I go in a .tex file, I want omni completion so I can use vimtex omni suggestions to my advantage. When I type \a for example, the suggestions are correct and I get this:
However with some letters, some completion is missing. For example if I type \b I get:
Which is missing a LOT of omni completions. For example \beta, or \backslash. If I type
<c-x><c-o>
with \b I get:And I dont get any of that with nvim-cmp
I have noticed the same problem with \s, \e, and a lot of other letters. For example \p does include all the options from the omni completion, but this varies from time to time.
This is my init.vim:
The text was updated successfully, but these errors were encountered: