Skip to content

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

Closed
Enselic wants to merge 4 commits into
store-contexts-in-syntax-referencesfrom
plain-text-reference-fallback
Closed

Fall back to "Plain Text" if embeds are missing#6
Enselic wants to merge 4 commits into
store-contexts-in-syntax-referencesfrom
plain-text-reference-fallback

Conversation

@Enselic

@Enselic Enselic commented Oct 24, 2021

Copy link
Copy Markdown
Owner

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

Enselic commented Mar 14, 2022

Copy link
Copy Markdown
Owner Author

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

Development

Successfully merging this pull request may close these issues.

1 participant