On Thu, Jul 09, 2009 at 05:53:42PM +0200, Enrico Forestieri wrote: > On Thu, Jul 09, 2009 at 05:25:02PM +0200, Vincent van Ravesteijn - TNW wrote: > > > > >Better fix for bug #5923. Now the macro name can be freely edited. > > > > I was by the way experiencing difficulties with Undo. After pressing > > backspace in a macro, there was no way to undo changes before hitting > > backspace. > > > > Don't know whether that's still a problem. > > I was aware of some problem with undo, but wasn't caring much as I was > looking for a better fix. I don't see any problem now (famous last words).
Indeed, I see an issue when *adding* characters to a macro name, as no undo information is recorded. However, this is independent of my patch and the attached seems to cure it. -- Enrico
Index: src/mathed/InsetMathNest.cpp =================================================================== --- src/mathed/InsetMathNest.cpp (revisione 30424) +++ src/mathed/InsetMathNest.cpp (copia locale) @@ -837,9 +837,12 @@ void InsetMathNest::doDispatch(Cursor & cur.posBackward(); cur.pushBackward(*cur.nextInset()); } - } else if (!interpretChar(cur, cmd.argument()[0])) { - cmd = FuncRequest(LFUN_FINISHED_FORWARD); - cur.undispatched(); + } else { + cur.recordUndo(); + if (!interpretChar(cur, cmd.argument()[0])) { + cmd = FuncRequest(LFUN_FINISHED_FORWARD); + cur.undispatched(); + } } break;