Multi-computer language, that is. `latex` and `r` are both
languages I'm using mixed together, but it would work with html+php or
html+css+javascript etc. etc.
@language r latex
is the same as just
@language r
and
@language latex r
is the same as just
@language latex
I.e. Leo looks at only the first word on a @language line, allowing you
to list other inactive languages after that word. Then, put this code
on a button or whatever:
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")
that searches upwards for a containing node which list multiple
languages, and cycles the current to the end of the list.
The c.selectVisBack() / c.selectVisNext() is a workaround because
c.redraw() by itself doesn't refresh syntax highlighting.
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 http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.