Permalink
Browse files

Merge pull request #31 from trishume/fix-30

Fix issue #30
  • Loading branch information...
2 parents 6845d92 + ecb0c6d commit 17b4e5064b9b6fe44bf2a0a0622f9bf9fadb3bb1 @trishume committed on GitHub Jan 8, 2017
Showing with 11 additions and 1 deletion.
  1. +10 −1 src/parsing/syntax_set.rs
  2. +1 −0 testdata/issue30.tex
@@ -285,7 +285,16 @@ impl SyntaxSet {
// println!("{:?}", context_ref);
use super::syntax_definition::ContextReference::*;
let maybe_new_context = match *context_ref {
- Named(ref s) => syntax.contexts.get(s),
+ Named(ref s) => {
+ // This isn't actually correct, but it is better than nothing/crashing.
+ // This is being phased out anyhow, see https://github.com/sublimehq/Packages/issues/73
+ // Fixes issue #30
+ if s == "$top_level_main" {
+ syntax.contexts.get("main")
+ } else {
+ syntax.contexts.get(s)
+ }
+ }
Inline(ref context_ptr) => {
let mut mut_ref = context_ptr.borrow_mut();
self.link_context(syntax, mut_ref.deref_mut());
@@ -0,0 +1 @@
+\title{}

0 comments on commit 17b4e50

Please sign in to comment.