I have a Leo-Editor script that pops up a window to interact with the
user and when the user is happy with his changes, my script closes the
pop-up window and sets the headline of the currently selected node.
Note that the user may change one or more nodes in this way and move
around in the Leo-Editor file for quite some time before closing the
Leo-Editor file.  Unfortunately, when a script changes a headline, Leo-
Editor does NOT set the file dirty flag.  This is a serious problem
for my script because the user could easily lose changes he has made.

If you are interested in this problem, I give much more detail here:

https://bugs.launchpad.net/leo-editor/+bug/1174915


So far the best work around I have come up with is:

        # Workaround bug: Leo doesn't notice headline change.
        self._p.b = self._p.b + ' '
        self._p.b = self._p.b[:-1]

That is, append a blank to the body of the changed node then drop the
appended blank.  These two steps are required because simply setting
the body to itself unchanged does NOT set the file dirty flag.

Edward requested that discussion of this problem be continued on this
forum hoping that more people will state their views.

My view is that a user expects (and should expect) Leo-Editor to
notice that a headline has been changed.  The file dirty flag should
be set.  As it is in this case, Leo-Editor is a very quirky, scripting-
unfriendly application.

-- 
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?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to