src/Tools/jEdit/src/plugin.scala
changeset 44163 32e0c150c010
parent 44160 8848867501fb
child 44185 05641edb5d30
     1.1 --- a/src/Tools/jEdit/src/plugin.scala	Fri Aug 12 20:32:25 2011 +0200
     1.2 +++ b/src/Tools/jEdit/src/plugin.scala	Fri Aug 12 22:10:49 2011 +0200
     1.3 @@ -327,15 +327,20 @@
     1.4  
     1.5    private val file_store = new Session.File_Store
     1.6    {
     1.7 -    def read(path: Path): String =
     1.8 +    def append(master_dir: String, path: Path): String =
     1.9      {
    1.10 -      val platform_path = Isabelle_System.platform_path(path)
    1.11 -      val canonical_path = MiscUtilities.resolveSymlinks(platform_path)
    1.12 +      val vfs = VFSManager.getVFSForPath(master_dir)
    1.13 +      if (vfs.isInstanceOf[FileVFS])
    1.14 +        MiscUtilities.resolveSymlinks(
    1.15 +          vfs.constructPath(master_dir, Isabelle_System.platform_path(path)))
    1.16 +      else vfs.constructPath(master_dir, Isabelle_System.standard_path(path))
    1.17 +    }
    1.18  
    1.19 -      Isabelle.jedit_buffers().find(buffer =>
    1.20 -          MiscUtilities.resolveSymlinks(buffer.getPath) == canonical_path) match {
    1.21 -        case Some(buffer) => Isabelle.buffer_text(buffer)
    1.22 -        case None => Standard_System.read_file(new File(platform_path))
    1.23 +    def require(canonical_name: String)
    1.24 +    {
    1.25 +      Swing_Thread.later {
    1.26 +        if (!Isabelle.jedit_buffers().exists(_.getSymlinkPath == canonical_name))
    1.27 +          jEdit.openFile(null: View, canonical_name)
    1.28        }
    1.29      }
    1.30    }