On Thu, 2006-02-23 at 12:44 +0100, Jean-Marc Lasgouttes wrote:
> >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> Ah, and by the way I think you should put the whole stanza in
> Martin> an 'else' block, as I did in my patch. Gives better cursor
> Martin> positioning when clicking on the left of an object that has
> Martin> inset on its left (I could even imagine illegal positionings
> Martin> otherwise).
> 
> Yes, I saw that in your patch and forgot to ask about it. I do not
> understand what it does (and why it is needed) and therefore I am a
> bit reluctant...

OK, here is the explanation (why not put it in a comment in the patch,
if you can formulate a short one)

You want to guarantee that the cursor is always to the left of the
current inset(*) in all slices but the tip. This is what the code does:
it first moves one to the left (if possible) but then again one to the
right IF that does NOT mean skipping over an editable inset. The result
is that if you click on an inset, you will always end up to the left of
it in the non-tip slices. Like this:

main          |
slice 1       [        |                      ]
slice 2                [  |               ]
tip slice                 [    |  ]

not, e.g.:

main          |
slice 1       [        |                      ]
slice 2                [          |       ]
tip slice                 [    |  ]     !

("!" is mispositioned "ghost" cursor on screen)

( (*) I.e., the inset containing the visible cursor, i.e., the tip/top
of the cursor stack)

However, you should also look at the code before the stanza. There, two
distances are compared: the distance from the "gap" right of the click
point to the click point, and that from the "gap" left of the click
point.

If you click on the left half of a NON-editable-inset (e.g., a symbol),
you will first be positioned on its left side by this distance-compare
mechanism. Then, if on the left side is an editable inset, you will be
further moved one place left. So in this situation:


       XXX[this is an editable inset][this is a symbol]XXX
          ^                          ^   ^
   but goes here        should go here   click here

The 'else' condition I add prevents this: when ending up left of
'symbol', no further move to the left is performed.

(There is no problem when clicking on the right half of symbol)

I saw this happening when I instrumented the code with multiple output
statements for it - begin(). You would understand too if you did that.

I suspect that some of Juergen's problems are due to this.

- Martin

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

Reply via email to