src/Tools/jEdit/src/plugin.scala
changeset 43482 ebb90ff55b79
parent 43460 2852f309174a
child 43487 98cd7e83fc5b
     1.1 --- a/src/Tools/jEdit/src/plugin.scala	Mon Jun 20 12:13:43 2011 +0200
     1.2 +++ b/src/Tools/jEdit/src/plugin.scala	Mon Jun 20 22:43:56 2011 +0200
     1.3 @@ -39,11 +39,6 @@
     1.4    var session: Session = null
     1.5  
     1.6  
     1.7 -  /* extended syntax styles */
     1.8 -
     1.9 -  def extended_styles: Boolean = plugin != null && plugin._extended_styles
    1.10 -
    1.11 -
    1.12    /* properties */
    1.13  
    1.14    val OPTION_PREFIX = "options.isabelle."
    1.15 @@ -270,19 +265,6 @@
    1.16  
    1.17  class Plugin extends EBPlugin
    1.18  {
    1.19 -  /* extended syntax styles */
    1.20 -
    1.21 -  @volatile var _extended_styles: Boolean = false
    1.22 -
    1.23 -  private def check_extended_styles()
    1.24 -  {
    1.25 -    val family = jEdit.getProperty("view.font")
    1.26 -    val size = jEdit.getIntegerProperty("view.fontsize", 12)
    1.27 -    val styles = SyntaxUtilities.loadStyles(family, size)
    1.28 -    _extended_styles = (styles.length == JEditToken.ID_COUNT * 4 + 1)
    1.29 -  }
    1.30 -
    1.31 -
    1.32    /* session management */
    1.33  
    1.34    private def init_model(buffer: Buffer)
    1.35 @@ -373,7 +355,6 @@
    1.36      message match {
    1.37        case msg: EditorStarted =>
    1.38        Isabelle.check_jvm()
    1.39 -      check_extended_styles()
    1.40        if (Isabelle.Boolean_Property("auto-start")) Isabelle.start_session()
    1.41  
    1.42        case msg: BufferUpdate
    1.43 @@ -408,15 +389,15 @@
    1.44      }
    1.45    }
    1.46  
    1.47 -
    1.48    override def start()
    1.49    {
    1.50 -    ModeProvider.instance = new Token_Markup.Mode_Provider(ModeProvider.instance)
    1.51      Isabelle.plugin = this
    1.52      Isabelle.setup_tooltips()
    1.53      Isabelle.system = new Isabelle_System
    1.54      Isabelle.system.install_fonts()
    1.55      Isabelle.session = new Session(Isabelle.system)
    1.56 +    SyntaxUtilities.setStyleExtender(new Token_Markup.Style_Extender)
    1.57 +    ModeProvider.instance = new Token_Markup.Mode_Provider(ModeProvider.instance)
    1.58      Isabelle.session.phase_changed += session_manager
    1.59    }
    1.60