(from a GitHub discussion)

If you use

@language html css javascript

the node will be highlighted as html

the button code below cycles the @language line:

    @language html css javascript ->
    @language javascript html css ->
    @language css javascript html ->
    @language html css javascript -> ...

so syntax highlighting cycles through those languages.

nd = p
while not p.isRoot():
    if p.b.strip().startswith("@language "):
        lines = p.b.strip().split('\n', 1)
        words = lines[0].split()
        current = words[1]
        words[1:] = words[2:]
        words.append(current)
        p.b = '\n'.join([' '.join(words)]+lines[1:])
        c.selectVisBack()
        c.selectVisNext()
        c.redraw()
        break
    p = p.parent()
else:
    g.es("None found")


Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to