I'd like to make a script that adds Latex end of line characters \\ to the end of each line in a block of body text that I have highlighted in Leo. I know this probably isn't complicated, but then neither am I.ThanksIH
--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/2fab05c1-21f9-48be-a402-90af2b21b638n%40googlegroups.com.
There are plenty of ways to do it in LEO but this is how I do it.Create a @button node with script, select text in body, and run:
@language python
#get selected text from body
w = c.frame.body.wrapper
s = w.getSelectedText()
start,end=w.getSelectionRange()
b=p.b
#do something
s=s.replace('\n','\\\\\n')
#insert edited text back
p.b=b[:start]+s+b[end:]
c.redraw()
--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/92f3c9ea-ad0b-4e23-bfdd-ba98a7fb212bn%40googlegroups.com.