Skip to content
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

Support implicit and shortcut reference links #709

Open
reagle opened this issue Sep 2, 2022 · 4 comments
Open

Support implicit and shortcut reference links #709

reagle opened this issue Sep 2, 2022 · 4 comments
Labels
C: key bindings Category: Key bindings enhancement

Comments

@reagle
Copy link

reagle commented Sep 2, 2022

F12 allows me to bounce between the first link and its reference, but not the latter two:

According to <https://pandoc.org/MANUAL.html#reference-links>:

[My first link][first] is explicit, 
my [second link][] is implicit,
my [third link] is a shortcut.

[first]: /bar/baz
[second link]: /baz/bar
[third link]: /foo/bar
@reagle
Copy link
Author

reagle commented Jan 4, 2023

An aside: once I hit F12, how do I get back to the link? Is the a shortcut to bounce back?

@deathaxe
Copy link
Member

deathaxe commented Jan 4, 2023

Basically bounce should move caret between reference and definition in both directions. I am not too familiar with current implementation though.

My goal would be to make it behave more like normal Goto Definition and Goto Reference somehow and maybe rely on syntax rather than trying to reparse document using regexp patterns.

@reagle
Copy link
Author

reagle commented Jan 4, 2023

On the aside: There's no bounce, it's f12 and shift+f12, and I had a keyboard collision from BetterBookmarks messing it up. I sorted that part out.

On the substantive issue, I'm afraid I don't know anything about the implementation (e.g., regex vs syntax AST). Would still love to see implicit and shortcut references though. :)

@deathaxe
Copy link
Member

deathaxe commented Jan 5, 2023

Sure. I need to come up with a plugin, which searches all sorts of links using ST's find_by_scope API. The current solution uses plain regex, which basically duplicates, what syntax definitions have already done.

TBH, I want to finalize some library stuff for Package Control 4.x first as it seems more important to me.

@deathaxe deathaxe added enhancement C: key bindings Category: Key bindings labels Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: key bindings Category: Key bindings enhancement
Projects
None yet
Development

No branches or pull requests

2 participants