404 { |
404 { |
405 snapshot.cumulate[Vector[Text.Info[PIDE.editor.Hyperlink]]]( |
405 snapshot.cumulate[Vector[Text.Info[PIDE.editor.Hyperlink]]]( |
406 range, Vector.empty, Rendering.hyperlink_elements, _ => |
406 range, Vector.empty, Rendering.hyperlink_elements, _ => |
407 { |
407 { |
408 case (links, Text.Info(info_range, XML.Elem(Markup.Path(name), _))) => |
408 case (links, Text.Info(info_range, XML.Elem(Markup.Path(name), _))) => |
409 val link = PIDE.editor.hyperlink_file(jedit_file(name)) |
409 val link = PIDE.editor.hyperlink_file(true, jedit_file(name)) |
410 Some(links :+ Text.Info(snapshot.convert(info_range), link)) |
410 Some(links :+ Text.Info(snapshot.convert(info_range), link)) |
411 |
411 |
412 case (links, Text.Info(info_range, XML.Elem(Markup.Url(name), _))) => |
412 case (links, Text.Info(info_range, XML.Elem(Markup.Url(name), _))) => |
413 val link = PIDE.editor.hyperlink_url(name) |
413 val link = PIDE.editor.hyperlink_url(name) |
414 Some(links :+ Text.Info(snapshot.convert(info_range), link)) |
414 Some(links :+ Text.Info(snapshot.convert(info_range), link)) |
416 case (links, Text.Info(info_range, XML.Elem(Markup(Markup.ENTITY, props), _))) |
416 case (links, Text.Info(info_range, XML.Elem(Markup(Markup.ENTITY, props), _))) |
417 if !props.exists( |
417 if !props.exists( |
418 { case (Markup.KIND, Markup.ML_OPEN) => true |
418 { case (Markup.KIND, Markup.ML_OPEN) => true |
419 case (Markup.KIND, Markup.ML_STRUCTURE) => true |
419 case (Markup.KIND, Markup.ML_STRUCTURE) => true |
420 case _ => false }) => |
420 case _ => false }) => |
421 val opt_link = PIDE.editor.hyperlink_def_position(snapshot, props) |
421 val opt_link = PIDE.editor.hyperlink_def_position(true, snapshot, props) |
422 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
422 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
423 |
423 |
424 case (links, Text.Info(info_range, XML.Elem(Markup(Markup.POSITION, props), _))) => |
424 case (links, Text.Info(info_range, XML.Elem(Markup(Markup.POSITION, props), _))) => |
425 val opt_link = PIDE.editor.hyperlink_position(snapshot, props) |
425 val opt_link = PIDE.editor.hyperlink_position(true, snapshot, props) |
426 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
426 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
427 |
427 |
428 case (links, Text.Info(info_range, XML.Elem(Markup.Citation(name), _))) => |
428 case (links, Text.Info(info_range, XML.Elem(Markup.Citation(name), _))) => |
429 val opt_link = |
429 val opt_link = |
430 Bibtex_JEdit.entries_iterator.collectFirst( |
430 Bibtex_JEdit.entries_iterator.collectFirst( |
431 { case (a, buffer, offset) if a == name => |
431 { case (a, buffer, offset) if a == name => |
432 PIDE.editor.hyperlink_buffer(buffer, offset) }) |
432 PIDE.editor.hyperlink_buffer(true, buffer, offset) }) |
433 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
433 opt_link.map(link => links :+ Text.Info(snapshot.convert(info_range), link)) |
434 |
434 |
435 case _ => None |
435 case _ => None |
436 }) match { case Text.Info(_, _ :+ info) :: _ => Some(info) case _ => None } |
436 }) match { case Text.Info(_, _ :+ info) :: _ => Some(info) case _ => None } |
437 } |
437 } |