problems with compoundEdit for macros (jEdit 4.3pre5)
Martin Raspe <hertzhaft <at> biblhertz.it>
2006-06-01 10:03:14 GMT
Hi all,
I noticed a recent change in the jEdit 4.3pre5 code in the CVS: When a
macro is invoked, a "beginCompoundEdit" is done automatically before
macro execution and a "endCompoundEdit" afterwards. This leads to
serious problems.
First problem: many existing macros which include buffer switching are
now broken (OK, those in the CVS have been adapted).
Second and more serious problem: If you start recording a macro, switch
to another buffer, then stop recording and play the macro back, jEdit is
left in an inconsistent state because of an unbalanced pair of
CompoundEdits. "Go to line nr" and hypersearch don't work any more; the
only thing you can do is exit jEdit and start anew.
I have not seen a thorough explanation why this "guarding" of macros is
really necessary. Many macros don't change the buffer and therefore
don't need it. Others have explicit begin/endCompoundEdit guards inside.
Macro *writers* will be aware of compoundEdit, while normal users that
just record macros can ruin their editing session. This is not a good
thing, I figure.
Moreover it's a nuisance protecting one's macros against this
protection. A macro is not always executed through Macros.invoke; I tend
to test them by "eval"ing them with beanshell. Special care is needed
when you invoke other macros from a macro, because the outer macro has
to keep track of all begin/endCompoundEdits and restore the original state.
Thus I'd strongly vote for taking this change out of the code again.
Opinions?
Martin
-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
--
--
-----------------------------------------------
jEdit Developers' List
jEdit-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-devel