On Wed, 2005-04-06 at 15:38, Helge Hafting wrote:

...

> >It does help. Attached a new patch doing two things:
> >
> >1) it tests for ncols() > 0 (I.e., establishes that this is
> >a "grid-type" nest inset) before trying to update anything involving
> >column numbers. This fixes your bug, Helge.
> >
> >2) It adds code to allow a math font or decoration inset to go "around"
> >selected text, in the way the delim inset does already. (Heck, this was
> >tricky.)
> >
> >Please review.
> >  
> >
> Pressing END inside matching parantheses no longer kills lyx, nice.
> Instead, the cursor goes to the last paranthesis. 

By design :-)

> I can't
> get to the end of line with END alone, but maybe the key isn't
> meant to do that in math?

Hmmm, it might be nice to enable END at the last position to exit the
parentheses. Opinions?

> The selection stuff did not improve for me, though.
> Type C-M 1+2+3+4
> Mark 2+3
> Type M-M(       [or do the same thing from math panel]
> I get: (2+3)1++4 still.  Or was this meant to be used cumulatively
> with your earlier patch?` I skipped that one, believing this
> was a newer iteration of the whole thing. Or should I do a cvs update again?
> This patch applied with no errors of any kind.
> 
> Helge Hafting

You should have this:

        if (i1.inset().asMathInset()) {
                cur.top() = i1;
                if (i1.idx() == i2.idx()) {
                        i1.cell().erase(i1.pos(), i2.pos());
                } else {
                        MathInset * p = i1.asMathInset();
                        InsetBase::row_type r1, r2;
                        InsetBase::col_type c1, c2;
                        region(i1, i2, r1, r2, c1, c2);
                        for (InsetBase::row_type row = r1; row <= r2; ++row)
                                for (InsetBase::col_type col = c1; col <= c2; 
++col)
                                        p->cell(p->index(row, col)).clear();
                        // We've deleted the whole cell. Only pos 0 is valid.
                        cur.pos() = 0;
                }
                cur.resetAnchor();

in CutAndPaste.C now. This is what makes the positioning work. For me it
does.

- Martin

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to