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

Jump to word when double-clicked on preview tab #762

Closed
samuelpetroline opened this issue Jul 25, 2020 · 4 comments
Closed

Jump to word when double-clicked on preview tab #762

samuelpetroline opened this issue Jul 25, 2020 · 4 comments
Labels
Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. Issue: Feature Something brand new. Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue.

Comments

@samuelpetroline
Copy link

I was wondering if there is any way to jump to a word when the respective word is double-clicked on the preview tab?

If not, is PR welcome?

Thanks for the extension, is amazing!

@yzhang-gh
Copy link
Owner

yzhang-gh commented Jul 25, 2020

Thank you.

VSCode itself has an attempt that synchronizes the source editor and the preview pane, although it is problematic in practice 😔.

Actually I had the same idea as yours (double-click to sync, on both sides) this morning when I was editing the long README of this extension. But for me it doesn't have a high priority because I don't use the preview tab that often.

If not, is PR welcome?

Of course. And probably you can borrow some code from LaTeX Workshop which has the feature.

@yzhang-gh yzhang-gh added Issue: Feature Something brand new. Help wanted Looking for help. labels Jul 25, 2020
@samuelpetroline
Copy link
Author

VSCode sync is good but could be more feature-rich. Guess is not the primary use for this.

I will be looking into this then. Thanks for the info and the example.

@rlnt
Copy link

rlnt commented Aug 2, 2020

I'd love to see this as well. :)

@Lemmingh Lemmingh added Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue. labels Jan 23, 2021
@Lemmingh Lemmingh added Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. and removed Help wanted Looking for help. labels Aug 24, 2021
@Lemmingh
Copy link
Collaborator

Lemmingh commented Oct 9, 2021

Unfortunately, this cannot be solved on our side.

Please turn to microsoft/vscode#131639


LaTeX Workshop makes it thanks to the precise source map provided by SyncTeX and the toolchain:

we ask TeX to report for each box the stored file name, the stored line number, the horizontal and vertical positions, and the dimensions as computed during typesetting.

we also ask TeX to store input records for glue items, because they are created in TeX’s mouth, when the current input record is still accurate.


But markdown-it's is very rough:

End line in map is a line when the rule terminates itself

Very limited implementation, restricted by current architecture


A solution might be fuzzy search in a range.

@Lemmingh Lemmingh closed this as completed Oct 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Preview The Markdown preview is owned by VS Code. We have nearly no control. Issue: Feature Something brand new. Res: External Outside of our control/codebase. Upstream Pertaining to an upstream component, or blocked by an upstream issue.
Projects
None yet
Development

No branches or pull requests

4 participants