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

Fall back to "Plain Text" if embeds are missing #6

Conversation

Enselic
Copy link
Owner

@Enselic Enselic commented Oct 24, 2021

Currently, syntect (and bat, see sharkdp/bat#915) panics for syntaxes that tries to embed a scope (typically another language) that is not present.

However, in the same scenario, Sublime Text does not crash. Instead, Sublime seems to fallback to Plain Text syntax, which actually seems very reasonable. Because embeds always have an escape out of the Plain Text.

This PR implements falling back to Plain Text if embeds are missing.

I'm marking this as Draft because

I would love to get your early feedback on this approach before I polish it further. Do you think this could work?

@Enselic Enselic marked this pull request as ready for review October 24, 2021 06:08
@Enselic Enselic marked this pull request as draft October 24, 2021 06:10
Enselic pushed a commit that referenced this pull request Jan 7, 2022
So that we can add variants and variant fields without semver breakage. This
will likely be needed to fall back to "Plain Text" if embeds are missing. See
prototype code at #6
Enselic added a commit that referenced this pull request Jan 7, 2022
So that we can add variants and variant fields without semver breakage. This
will likely be needed to fall back to "Plain Text" if embeds are missing. See
prototype code at #6
@Enselic
Copy link
Owner Author

Enselic commented Mar 14, 2022

Obsoleted by trishume#427

@Enselic Enselic closed this Mar 14, 2022
@Enselic Enselic deleted the plain-text-reference-fallback branch March 14, 2022 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant