|
From: Slava P. <sl...@je...> - 2003-01-31 16:02:00
|
Because macro execution is automatically wrapped in begin/endCompoundEdit() and calling undo() from inside a compound edit causes this. You should find another way to achieve the same effect. On January 31, 2003 04:50 am, Rudi Widmann wrote: > Hello, > I want to undo all text manipulations done inside a beanshell macro if > an error occurs. > I do following coding: > > buffer.beginCompoundEdit(); > <some code> > buffer.endCompoundEdit(); > if (errorsFound) > buffer.undo(textArea); > > then, I receive an exception: > [error] BeanShell: java.lang.InternalError: Unbalanced > begin/endCompoundEdit() > [error] BeanShell: at > org.gjt.sp.jedit.buffer.UndoManager.undo(UndoManager.java:58) > [error] BeanShell: at org.gjt.sp.jedit.Buffer.undo(Buffer.java:1255) > [error] BeanShell: at > sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) > ... > If I invoke "undo" after the macro run, it works fine. > > Any ideas ? > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com -- Slava Pestov |