src/Tools/jEdit/src/plugin.scala
changeset 43513 06951ddfc812
parent 43510 17d431c92575
child 43520 cec9b95fa35d
     1.1 --- a/src/Tools/jEdit/src/plugin.scala	Wed Jun 22 20:56:18 2011 +0200
     1.2 +++ b/src/Tools/jEdit/src/plugin.scala	Wed Jun 22 21:27:20 2011 +0200
     1.3 @@ -394,13 +394,15 @@
     1.4      Isabelle.system.install_fonts()
     1.5      Isabelle.session = new Session(Isabelle.system)
     1.6      SyntaxUtilities.setStyleExtender(new Token_Markup.Style_Extender(Isabelle.system.symbols))
     1.7 -    ModeProvider.instance = new Token_Markup.Mode_Provider(ModeProvider.instance)
     1.8 +    if (ModeProvider.instance.isInstanceOf[ModeProvider])
     1.9 +      ModeProvider.instance = new Token_Markup.Mode_Provider(ModeProvider.instance)
    1.10      Isabelle.session.phase_changed += session_manager
    1.11    }
    1.12  
    1.13    override def stop()
    1.14    {
    1.15 +    Isabelle.session.phase_changed -= session_manager
    1.16 +    Isabelle.jedit_buffers.foreach(Isabelle.exit_model)
    1.17      Isabelle.session.stop()
    1.18 -    Isabelle.session.phase_changed -= session_manager
    1.19    }
    1.20  }