Skip to content
This repository has been archived by the owner on Aug 31, 2022. It is now read-only.

Following links doesn't work when the link has a multi-word description #6

Open
voidus opened this issue Nov 25, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@voidus
Copy link

voidus commented Nov 25, 2021

When trying to follow a link [[xyz|that looks like this]], it says "There is no link under the cursor".

Seems to be caused by local word = vim.fn.expand("<cWORD>"), calling :echo expand("<cWORD>") prints something like [[xyz|that or looks

@pyrho pyrho added the bug Something isn't working label Nov 30, 2021
@pyrho
Copy link
Owner

pyrho commented Nov 30, 2021

My guess is that this will only work if you place your cursor on the beginning on the virtual text (which really only masks the "real" characters that are actually in the file). So I guess that's a workaround for now.

As you pointed out the issue is that we rely on getting the <cWORD> (the WORD currently under the cursor), it was easier to do it this way but it should be fairly easy to get the whole link under the cursor and just feed that to the "link parsing" regexp that's used in the virtual title populating function.

I will look into it shortly (🤞)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants