I have the following code in an @command node:
w = c.frame.body.bodyCtrl
w.setFocus()
start,end = w.getSelectionRange()
w.insert(start, {)
w.insert(end+1, })
c.setChanged()
w.setFocus()
=
It brackets the current text selection with curly braces.
The code seems to work fine at first. The braces appear in the body text.
But when I do a save, the changes are reverted. If I do an edit manually
in the buffer before saving then the changes are retained. It seems that
the changes made by the script are not setting the text as changed. Is
this something to do with the undoer or something else? I've checked in
the docs and searched here, and found nothing relating.
--
You received this message because you are subscribed to the Google Groups
leo-editor group.
To view this discussion on the web visit
https://groups.google.com/d/msg/leo-editor/-/88YaBrZtzx0J.
To post to this group, send email to leo-editor@googlegroups.com.
To unsubscribe from this group, send email to
leo-editor+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.