Closed whisperity closed 2 months ago
Reference label completion list does not open following
\hyperref[
(for custom-labelled references)
Why did you link "custom-labelled-references" to http://example.com?
Expected behavior
A dropdown should appear for all three commands, like this: …
First: You are leaving out a lot of VERY important context here. I believe I can infer things correctly, but it would be much better if I did not need to make any assumptions about your issue.
To be specific: "A dropdown should appear" is only right if you either 1) specify that you press e.g. <c-x><c-o>
to trigger omnicompletion or 2) use some type of autocompletion plugin. You did not specify which of these, which makes your description incomplete.
Now, completion for \hyperref[...
is available, and if you test it with regular omnicompletion with <c-x><c-o>
I believe you will find that it works as expected. Thus, I believe the problem lies with your configuration or choice of autocomplete engine.
Notice, there is a reason why the issue template asks for a minimal example that involves a minimal test.vim
or vimrc
file. :)
@lervag Thanks for the reply! I never had to press anything to open a completion drop down so I didn't know about that keybind at all before. Is it Vimtex-specific or something else?
I do use coc.nvim when running NeoVim, but to the best of my understanding it should be disabled for non-C++ files. Tomorrow I will investigate a bit further. I was surprised to see this behaviour because otherwise I saw mentions of the hyperref
commands in the source code alongside cleveref
's and whatnot so I tried to infer that it should work or at least worked in the past...
Alright, it turns out that pressing C-x C-o
will bring forth the autocompletion appropriately. And it turns out that there is a thing called coc-vimtex which drove the whole autocompletion up until this point.
Do you know of that plugin, or is it completely third-party? I found some mentions of the completion in VimTex's help file. But it looks like this issue should be reposted to that project instead?
@lervag Thanks for the reply!
:)
I never had to press anything to open a completion drop down so I didn't know about that keybind at all before. Is it Vimtex-specific or something else?
It is not VimTeX specific, no. It is built-in to Vim and neovim. I believe, based on what you are writing, that you are not very aware of which features you are using that are built-in and which ones are provided by plugins. It also doesn't seem like you are fully aware of which plugins you are using. This makes it harder for me to help. I would strongly suggest reading the Vim user manual (:help user-manual
), as I believe learning the basics and intermediate built-in Vim features is a good idea for everyone who really wants to use Vim (or neovim).
Alright, it turns out that pressing
C-x C-o
will bring forth the autocompletion appropriately.
Good; as expected.
And it turns out that there is a thing called coc-vimtex which drove the whole autocompletion up until this point.
Do you know of that plugin, or is it completely third-party? I found some mentions of the completion in VimTex's help file. But it looks like this issue should be reposted to that project instead?
Yes, coc-vimtex
is a wrapper for coc.nvim that brings VimTeXs omni-complete function as a source.
I believe the reason you don't get automatic completion is because the pattern used to trigger completion either lacks the hyperref
part or has some bug:
https://github.com/neoclide/coc-vimtex/blob/master/src/index.js#LL19C1-L19C916
Compare this to similar regexes provided by VimTeX, e.g. this one:
So, to fix this, you need to get whomever is maintaining coc-vimtex to check if there is either a bug with the regex or if it lacks the hyperref
word.
Closing this as it seems resolved by my last comment.
Description
Reference label completion list does not open following
\hyperref[
(for custom-labelled references) even though\ref{
or\cref{
opens the list normally.Steps to reproduce
Navigate to the line indicated by
%
and start typing\ref{
or\cref{
, and\hyperref[
Expected behavior
A dropdown should appear for all three commands, like this:
Actual behavior
No drop-down is shown for arguments of the
\hyperref[
command.![Stale
\hyperref[
command entered](https://github.com/lervag/vimtex/assets/1969470/8a9fc6e3-6d54-477b-9436-f21808f22d60)The code is valid nevertheless and the PDF otherwise generates normally:
Do you use a latexmkrc file?
Yes (but this should not be relevant to the issue).
VimtexInfo