Repository navigation
[markdown-language-features]: Fix starting scroll for URIs with fragment - #111126
Merged
Matt Bierner (mjbvz) merged 1 commit intoJan 23, 2021
Merged
Matt Bierner (mjbvz) merged 1 commit into
Matt Bierner (mjbvz) merged 1 commit into
Conversation
Matt Bierner (mjbvz)
suggested changes
Jan 8, 2021
| } | ||
|
|
||
| preview.update(resource); | ||
| preview.update( |
Contributor
There was a problem hiding this comment.
Calling update here will force the preview to be re-rendered right away. Can the fragment be passed to the two calls above instead?
Member
Author
There was a problem hiding this comment.
Isn't preview.update already being called here? The PR just adds a second argument. Or are you saying including the second argument forces a re-render which wouldn't otherwise happen?
I didn't quite follow "the two calls above", could you clarify which lines you're referring to?
Contributor
|
Thanks! Will be in the next VS Code insiders |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't expect this PR will be merged as-is, but it does fix the issue. I expect a maintainer more familiar with
markdown-language-featuresmay want to tweak the implementation. In particular, there'sfragmentin multiple places when passed to the preview UI, and theindex.tsfile there is looking forfragmentonsettings, but it wasn't wired up there, so it would never be found. It's being passed instate, but I'm not sure how/why one is used over the other.This PR fixes previewing URIs with a fragment, by having the starting scroll respect the fragment location. Currently links with a URL fragment work as expected within the markdown preview, but when a link jumps to another file, the fragment isn't used. Same with executing the
markdown.showPreviewcommand with a fragment on the URI.Matt Bierner (@mjbvz) Megan Rogge (@meganrogge)