Hi all!I wrote here recently about the sometimes hard to use math macros in LyX:
http://www.mail-archive.com/[email protected]/msg53740.htmlAttached is an experimental patch against the 1.5 branch to make inline editing of macros possible, i.e. _without_ jumping back and forth between the LyX macro preview and the unfolded version with the #1, #2, ... lines.
The main idea is the following: If a macro is expanded, the MathMacroArguments are replaced by MathMacroArgumentValues. These have pointers to the MathMacro cells to (only) pass through draw and metric calls to the cell. Hence the MathMacroArgumentValues will behave like the cell visually.
This works quite nice, even if arguments appear multiple times in the macro definition. Also the cursor movement is acceptable. It just follows the order of argument appearances in the macro template.
I am not entirely sure whether the memory management is correct. It would help if somebody who knows this in LyX could take a look over it. Especially I wonder if the cell pointers can become invalid by deleting the cell, but keeping the MathMacroArgumentValue object, hence leading to a segfault.
Waiting for some comments Schimmi I
inlinemacros.diff
Description: Binary data
PGP.sig
Description: Signierter Teil der Nachricht
