On Sat, Apr 15, 2006 at 07:49:25PM +0200, Georg Baum wrote:
> The alternative to this approach (storing the delimiter as uneditable 
> string) would be to make the delimiter a normal cell. The advantage of 
> that is that MathNestInset and LCursor don't need to be touched, but the 
> disadvantage would be that one would ned to disable a lot of stuff in the 
> delimiter box. It would certainly be surprising for the user to see that 
> normal characters where disabled in a normal looking math box.
> 
> Opinions? Should I polish this version, or do we want to do it 
> differently?

Probably differently.

No need to disable lots of things, just ignore garbage. This is a
feature for advanced users anyway.


Index: src/cursor.C
         void LCursor::plainInsert(MathAtom const & t)
         {
        +       // Create a MathBigInset from cell()[pos() - 1] and t if 
possible
        +       if (!empty() && pos() > 0 && cell()[pos() - 
1]->asUnknownInset()) {
        +               string const name = asString(t);
        +               if (MathBigInset::isBigInsetDelim(name)) {
        +                       string prev = asString(cell()[pos() - 1]);
        +                       if (prev[0] == '\\') {
        +                               prev = prev.substr(1);
        +                               latexkeys const * l = in_word_set(prev);
        +                               if (l && l->inset == "big") {
        +                                       cell()[pos() - 1] =
        +                                               createMathInset(prev, 
name);
        +                                       return;
        +                               }
        +                       }
        +               }
        +       }
                cell().insert(pos(), t);
                ++pos();
         }

This function is called _plain_Insert.

Andre'

Reply via email to