On Tue, Dec 02, 2003 at 08:17:34PM +0200, Martin Vermeer wrote: > On Tue, Dec 02, 2003 at 04:18:27PM +0100, Michael Schmitt spake thusly: > > > > Hello, > > > > since Andre started to move code from InsetERT to InsetCollapsable, I > > will try finish this project (inline mode also for other insets). > > > > Just in case somebody had the same idea and already started work, please > > let me know so that we don't do the same work twice. > > > > Michael > > I would like to see inline mode for CharStyle insets with a bool > option in the .layout file. That way we can have the "elements" in XML > behave just like collapsable insets (which is fine and natural IMHO; > just Conglomerate upside down ;-) while the "character styles" in > LaTeX can be made to behave in a way that almost hides their > collapsable inset nature (just a box with text in-line, no label) > which I hope would make John happy. And me too. > > I haven't started yet, and now will wait to see how your work turns > out first. > > At a later stage I would then like to add "inset melting": backspace > in pos = 0 removes the surrounding inset, which addresses one of > Helge's peeves. Like in math. (André, which files should I study to > learn how to do this?)
This could be handled in LyXText::dispatch in the LFUN_BACKSPACE handler: check for pos == 0, save the paragraph list, pop one level of the cursor, paste (possibly by dispatching a 'LFUN_PASTE' to the BufferView::dispatch()) The equivalent code in mathed is situated in the MathCursor (backspace() and pullArg() and triggered directly from InsetFormula::dispatch() but I don't think this solution is optimal. Andre' -- Those who desire to give up Freedom in order to gain Security, will not have, nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)