On Tue, 2005-10-18 at 11:01 +0200, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > Martin> The attached fixes the bug, and I didn't see any side effects. > > I think it is not the right fix :) > > Martin> Anyone remember what this code was supposed to do? > > the boundary code is what tells whether you are at the right of > previous character or at the lest of the next one. This was introduced > for RtL support, but Juergen V. has extended it to allow positioning > the cursor either at end of row or beginning of next row before a > displayed inset (eg maths). This was an old bug, which number I do not > remember. > > I would think the real culprit is the code that sets boundary > unconditionally to true when inserting a character (at the end of > LyXText::insertChar): > > //setCursor(cur, cur.pit(), cur.pos() + 1, false, cur.boundary()); > setCursor(cur, cur.pit(), cur.pos() + 1, false, true); > > The commented out version is the original code, the second one was > added by Juergen V. It is with this line that you should experiment. > I guess the question is what happens when you insert something just > before a displayed math inset.
This works *partly*. Try, with you patch, this: 1) create a string 'aaaaa' in a cell of a table, and back up to the middle. 2) Type <space><left><space><right> where <left> and <right> stand for the cursor keys You will again find yourself in the table cell to the right. But let me bring up another matter. The reported bug is apparently, that the code in cursorRight: if (cur.boundary()) return setCursor(cur, cur.pit(), cur.pos(), true, false); if boundary == true, carries the cursor, not to the next *character*, but to the next *table cell*. It is as if the positioning is using a cursor slice on the wrong level of the cursor. Do you get what I mean? (BTW this bug occurs *only* in tabular. I couldn't find a similar bug in any other inset.) Anyway, what to try next? I'm still groping in the blind. Some more explanation please :-) - Martin
signature.asc
Description: This is a digitally signed message part