complete symbols within ML strings / comments;
authorwenzelm
Thu Feb 20 17:57:26 2014 +0100 (2014-02-20 ago)
changeset 55625d8eb606cf321
parent 55624 d52409077135
child 55626 0e2b7f04c944
complete symbols within ML strings / comments;
src/Tools/jEdit/src/rendering.scala
     1.1 --- a/src/Tools/jEdit/src/rendering.scala	Thu Feb 20 17:51:16 2014 +0100
     1.2 +++ b/src/Tools/jEdit/src/rendering.scala	Thu Feb 20 17:57:26 2014 +0100
     1.3 @@ -204,13 +204,16 @@
     1.4  
     1.5    private val completion_elements =
     1.6      Set(Markup.STRING, Markup.ALTSTRING, Markup.VERBATIM, Markup.CARTOUCHE,
     1.7 -      Markup.COMMENT, Markup.LANGUAGE)
     1.8 +      Markup.COMMENT, Markup.LANGUAGE, Markup.ML_STRING, Markup.ML_COMMENT)
     1.9  
    1.10    def completion_context(caret: Text.Offset): Option[Completion.Context] =
    1.11      if (caret > 0) {
    1.12        val result =
    1.13          snapshot.select_markup(Text.Range(caret - 1, caret + 1), completion_elements, _ =>
    1.14            {
    1.15 +            case Text.Info(_, elem)
    1.16 +            if elem.name == Markup.ML_STRING || elem.name == Markup.ML_COMMENT =>
    1.17 +              Some(Completion.Context(Markup.Language.ML, true))
    1.18              case Text.Info(_, XML.Elem(Markup.Language(language, symbols), _)) =>
    1.19                Some(Completion.Context(language, symbols))
    1.20              case Text.Info(_, XML.Elem(markup, _)) =>